[issue44973] @classmethod can be stacked on @property, but @staticmethod cannot

2021-08-22 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue44973] @classmethod can be stacked on @property, but @staticmethod cannot

2021-08-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: The classmethod and staticmethod decorators have somewhat different semantics. Accessing a classmethod with C.cm creates a bound method object which has both __call__ and __get__. In contrast, accessing a staticmethod with C.sm returns the underlying fun

[issue44973] @classmethod can be stacked on @property, but @staticmethod cannot

2021-08-21 Thread Tushar Sadhwani
New submission from Tushar Sadhwani : Starting with Python3.9, `@classmethod` can be stacked on top of `@property`, but it seems that `@staticmethod` cannot. >>> class C: ... @classmethod ... @property ... def cm(cls): ... return cls.__name__ ... @staticmethod ...