Skip to content
This repository was archived by the owner on Jun 10, 2020. It is now read-only.

Conversation

bedder
Copy link
Contributor

@bedder bedder commented Jul 9, 2019

Additions to support the datetime64 and timedelta64 classes, as described here.

@bedder bedder force-pushed the bedder/datetime64 branch from a902003 to 0795a22 Compare July 9, 2019 15:28
@@ -393,14 +394,39 @@ class number(generic):

class bool_(_real_generic): ...
class object_(generic): ...
class datetime64(_real_generic): ...

class datetime64:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Motivation behind removing inheritance of _real_generic: inheritance allowed code like this to pass mypy

np.timedelta64(0) - np.datetime64(0, 'D')

@bedder bedder force-pushed the bedder/datetime64 branch from 0795a22 to 5fdc260 Compare July 9, 2019 15:38
@@ -50,14 +51,14 @@ def test_fail(path, py2_arg):
with open(path) as fin:
lines = fin.readlines()

errors = {}
errors = defaultdict(lambda: "")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous iteration of the code didn't work too well when we had multi-line error messages (e.g. with overload matching errors), as it would just overwrite the error messages.

@shoyer shoyer merged commit ad402db into numpy:master Sep 12, 2019
@shoyer
Copy link
Member

shoyer commented Sep 12, 2019

Thanks @bedder!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants