Skip to content

Commit b3d8fec

Browse files
Adapt code example in advanced/classes.rst to new handling of forgetting to call the superclass __init__ (#2429)
1 parent 4493751 commit b3d8fec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/advanced/classes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Here is an example:
159159
160160
class Dachshund(Dog):
161161
def __init__(self, name):
162-
Dog.__init__(self) # Without this, undefined behavior may occur if the C++ portions are referenced.
162+
Dog.__init__(self) # Without this, a TypeError is raised.
163163
self.name = name
164164
def bark(self):
165165
return "yap!"

0 commit comments

Comments
 (0)