Or second: divide by a Timedelta representing 1 hour and get a floating point (or an integer!) as my return. This is obviously way less code
-
-
Actually I know of no algebra upon which addition and subtraction and *division* is defined but multiplication is not...

-
Python doesn't have a timesquared type so it omits that operator. perhaps this is an argument for actual units but those are complicated
-
Indeed they are. Which is why it would be a lot more semantically rich to provide methods to support the conversions.
-
Eh, I'd still want the division. Dividing periods by each other is useful.
-
Sure sure -- I'm not saying *remove* that capability. But .to_hours() should be supported.
-
I disagree - then you end up with to_years, to_months, to_weeks, to_days, to_hours, to_minutes, to_seconds, to_miliseconds...
-
It's redundant, and dividing by an hour is exactly how you'd do things mathematically
-
Who cares about redundancy? Readability is better than "how you'd do things mathematically."
- 1 more reply
New conversation -
-
-
values with units aren't scalars? i guess i never thought about it before but that seems weird
-
We can use a bunch of different things to represent units in an abstract mathematical sense, but it's not cut & dry.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.