8000 Merge pull request #19743 from anntzer/alias · numpy/numpy@94010e3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 94010e3

Browse files
authored
Merge pull request #19743 from anntzer/alias
MAINT: Avoid use of confusing compat aliases.
2 parents 47df8f8 + 60116f2 commit 94010e3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

numpy/lib/npyio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,9 +1537,9 @@ def fromregex(file, regexp, dtype, encoding=None):
15371537
dtype = np.dtype(dtype)
15381538

15391539
content = file.read()
1540-
if isinstance(content, bytes) and isinstance(regexp, np.compat.unicode):
1540+
if isinstance(content, bytes) and isinstance(regexp, str):
15411541
regexp = asbytes(regexp)
1542-
elif isinstance(content, np.compat.unicode) and isinstance(regexp, bytes):
1542+
elif isinstance(content, str) and isinstance(regexp, bytes):
15431543
regexp = asstr(regexp)
15441544

15451545
if not hasattr(regexp, 'match'):

numpy/random/_generator.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ cdef class Generator:
561561
raise TypeError('Unsupported dtype %r for integers' % _dtype)
562562

563563

564-
if size is None and dtype in (bool, int, np.compat.long):
564+
if size is None and dtype in (bool, int):
565565
if np.array(ret).shape == ():
566566
return dtype(ret)
567567
return ret

numpy/random/mtrand.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ cdef class RandomState:
763763
else:
764764
raise TypeError('Unsupported dtype %r for randint' % _dtype)
765765

766-
if size is None and dtype in (bool, int, np.compat.long):
766+
if size is None and dtype in (bool, int):
767767
if np.array(ret).shape == ():
768768
return dtype(ret)
769769
return ret

0 commit comments

Comments
 (0)
0