-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Description
Thanks for this work, I'm discovering nooks and crannies of Python that I wasn't previously aware of.
For the following section, I wanted to point out that what seems to matter is order of definition of the class attributes.
python_koans/koans/about_class_attributes.py
Lines 63 to 75 in 800cdf5
def bark(self): | |
return "instance bark" | |
def growl(self): | |
return "instance growl" | |
@staticmethod | |
def bark(): | |
return "staticmethod bark, arg: None" | |
@classmethod | |
def growl(cls): | |
return "classmethod growl, arg: cls=" + cls.__name__ |
The classmethod and staticmethod are redefining the instance methods. If order of each of bark
and growl
is flipped, the instance method will redefine the static/class method.
Metadata
Metadata
Assignees
Labels
No labels