diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2019-09-04 15:13:38 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-04 15:13:38 -0600 |
commit | af76d3b761c4047d314a4bc9a9793577fadcb46e (patch) | |
tree | 1704feda94219c961b9d83b9ac685f71ca021eeb | |
parent | 3f8d70ee3f85051f2a2cdaddb28e058316afd0b7 (diff) | |
parent | 5391ac3d426a9cfa1317e989e1b312dbe1d7b82f (diff) | |
download | numpy-af76d3b761c4047d314a4bc9a9793577fadcb46e.tar.gz |
Merge pull request #14395 from rgommers/doc-subcl
DOC: fix issue with __new__ usage in subclassing doc.
-rw-r--r-- | numpy/doc/subclassing.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/doc/subclassing.py b/numpy/doc/subclassing.py index 4b983893a..d0685328e 100644 --- a/numpy/doc/subclassing.py +++ b/numpy/doc/subclassing.py @@ -118,7 +118,8 @@ For example, consider the following Python code: def __new__(cls, *args): print('Cls in __new__:', cls) print('Args in __new__:', args) - return object.__new__(cls, *args) + # The `object` type __new__ method takes a single argument. + return object.__new__(cls) def __init__(self, *args): print('type(self) in __init__:', type(self)) |