I have a tech rant. I sometimes do tech on this account and not just Nazis. Frameworks that impose cleverness as praxis make me angry.
-
-
Mind you, this is not *python's* datetime library, it is a Subclass within a module that doesn't consistently implement such methods.
-
hm, unless it's doing something /extremely/ weird i wouldn't expect it to break base class operations
-
(it is doing something extremely weird)
End of conversation
New conversation -
-
-
That's an odd way to see it. Isn't a duration a scalar? Regardless of whether it's an object underneath or a primitive
-
In this context, it is not a scalar quantity.
-
For instance, we may do the following: (a - b) / pd.Timedelta(hours=12) But not (a - b) * pd.Timedelta(hours=1/12)
-
sure. the former results in a unitless quantity; the latter results in time squared, which timedelta cannot represent
-
Right, which is not the definition of a scalar.
-
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.
- 6 more replies
New conversation -
-
-
This just seems like semantic sugar in library form to me. I don't see a need for mathematical consistency.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
it's supported on the base timedelta type
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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.