Replies: 2 comments 2 replies
-
There may be a solution with a custom |
Beta Was this translation helpful? Give feedback.
0 replies
-
Found some more discrepancies, the most glaring of which is timestamp is a property on this leads to some fun issues with |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Can #133 be reconsidered?
There are two ways in which implementing the interface without subclassing is causing problems:
arrow.Arrow
is used wheredatetime.datetime
ordatetime.date
is expected.arrow.Arrow
does not pass anisinstance(datetime.datetime)
check. Arguably such check shouldn't be done, but if I am using a library that does this, then there's nothing I can do but usearrow.Arrow.datetime
.Using
arrow.Arrow.datetime
is a solution, but it's not as elegant as being able to passarrow.Arrow
directly.The downside might be that despite implementing the same interface, some functions may have different semantics than
datetime.datetime
. This could lead to unexpected results when expecting adatetime.datetime
. I haven't analysed it thoroughly, but it seems that most of the differences would be with classmethods rather than instance methods; it's rare to pass the type around rather than an instance, or to use classmethods on an instance.Is the stance still the same as it was 7 years ago? What are everyone's thoughts now?
Beta Was this translation helpful? Give feedback.
All reactions