Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Provide information about what kind is actually not integer kind #12093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion numpy/core/getlimits.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def __init__(self, int_type):
self.bits = self.dtype.itemsize * 8
self.key = "%s%d" % (self.kind, self.bits)
if self.kind not in 'iu':
raise ValueError("Invalid integer data type.")
raise ValueError("Invalid integer data type %r." % (self.kind,))
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks harmless at first glance if it helps a downstream project. I don't think we have plans to explicitly support Python 3.4 issues moving forward, but this may be fair enough.

I suppose one could add a unit test that uses a regex on the ValueError message, although maybe that's overkill.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FWIW those failures also happen with 3.5 at times (so I was told), or I misunderstood and this code path is 3.4 specific?

Copy link
Contributor

Choose a reason for hiding this comment

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

If the issue isn't 3.4-specific that probably make a more compelling case to fix it


def min(self):
"""Minimum value of given dtype."""
Expand Down