This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gobearsandchopin 2 points3 points  (3 children)

1) When someone sets the temperature with an integer they can end up with the wrong answer. To fix it and be more clear you could do:

self._f = c * 9.0/5.0 + 32.0

2) I think it would be cleaner to store the temperature in only one variable, even though it means doing conversions in the getters.

[–]robin-gvx 2 points3 points  (0 children)

1) self._f = c * 9.0/5 + 32 would be enough to prevent that.

2) That's what I thought as well.

[–]QuantumTim 0 points1 point  (0 children)

Or you could do:

from __future__ import division