Re: [Python-ideas] staticmethod and classmethod should be callable

June 21, 2018
2:08 a.m.
On 2018-06-21 11:00, INADA Naoki wrote:
One issue with that idea is that staticmethod, classmethod can actually arbitrary objects, not only Python functions. In fact, even this object can be created:
staticmethod(42) <staticmethod object at 0x7f74ab9c55f8>
So in that sense, they behave more like "method" which can also wrap arbitrary callables (in this case, callability is checked). So I'm vaguely thinking of putting "method", "staticmethod" and "classmethod" on top of a common base class for things wrapping callables. Jeroen.
2463
Age (days ago)
2463
Last active (days ago)
0 comments
1 participants
participants (1)
-
Jeroen Demeyer