Skip to content

Commit fc0764a

Browse files
committed
ENH: add __name__ attribue to ufuncs
Follow up to numpy#44. SciPy actually uses `__name__`, so add it.
1 parent 8bf2d45 commit fc0764a

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

numpy-stubs/__init__.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,8 @@ little_endian: int
620620
tracemalloc_domain: int
621621

622622
class ufunc:
623+
@property
624+
def __name__(self) -> str: ...
623625
def __call__(
624626
self,
625627
*args: _ArrayLike,

tests/pass/ufuncs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
np.sin(1, extobj=[16, 1, lambda: None])
1313
np.sin(1) + np.sin(1)
1414
np.sin.types[0]
15+
np.sin.__name__

0 commit comments

Comments
 (0)