10000 Allow long numbers in numpy.rec.array formats string by cgohlke · Pull Request #376 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Allow long numbers in numpy.rec.array formats string #376

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 4 commits into from
Sep 2, 2012
Merged
Show file tree
Hide file tree
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/_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def _reconstruct(subtype, shape, dtype):

format_re = re.compile(asbytes(
r'(?P<order1>[<>|=]?)'
r'(?P<repeats> *[(]?[ ,0-9]*[)]? *)'
r'(?P<repeats> *[(]?[ ,0-9L]*[)]? *)'
r'(?P<order2>[<>|=]?)'
r'(?P<dtype>[A-Za-z0-9.]*(?:\[[a-zA-Z0-9,.]+\])?)'))
sep_re = re.compile(asbytes(r'\s*,\s*'))
Expand Down
5 changes: 5 additions & 0 deletions numpy/core/tests/test_dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,11 @@ def test_complex_dtype_repr(self):
assert_equal(repr(dt),
"dtype([('a', '<M8[D]'), ('b', '<m8[us]')])")

@dec.skipif(sys.version_info[0] > 2)
def test_dtype_str_with_long_in_shape(self):
# Pull request #376
dt = np.dtype('(1L,)i4')


class TestDtypeAttributeDeletion(object):

Expand Down
0