python_koans icon indicating copy to clipboard operation
python_koans copied to clipboard

AboutClassAttributes: Order of definition matters

Open programmer-ke opened this issue 3 years ago • 0 comments

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.

https://github.com/gregmalcolm/python_koans/blob/800cdf5db9e8539681723ca541e03b28e2117b28/koans/about_class_attributes.py#L63-L75

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.

programmer-ke avatar Apr 05 '22 10:04 programmer-ke