Closed Sophist-UK closed 2 years ago
No - self is an Angle. Hence the need to float it to get a float.
class Angle(float):
"""CSS Angle defines as used in SVG/CSS"""
Yes, it returns Angle but Angle is a float.
No - Angle is an Angle. print(Angle is float)
gives False. And str(Angle(1.0).as_radians)
returns Angle(1.00000000) rather than
1.0`. Just because it is a subclass doesn't make it the same.
Jens transformation PR highlighted this BUG. If it hadn't shown up as a bug, I wouldn't have submitted this PR.
You certainly have a point. I'll check the others and make sure they return a proper float but really you can cast a float type to just a float type without any issue. But, it does seem a bit more consistent to do things this way if the other angles also do things that way.
Yeah, for the sake of consistency you shouldn't need to cast that as a float.
Should return a float not an Angle. Other similar properties return a result of a float calculation which is by default float.