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

On 2018-06-21 10:33, Serhiy Storchaka wrote:
Status quo wins.
Well, I'm already planning to make changes to staticmethod/classmethod (not right now, but it's on my post-PEP-580 roadmap). So the "status quo" argument doesn't apply. My question is really: assuming that we redesign staticmethod/classmethod anyway, should we make them callable?

My question is really: assuming that we redesign staticmethod/classmethod anyway, should we make them callable?
I think so. staticmethod and classmethod should affect descriptor behavior. And it should behave as normal function.
When Python 4, I think we can even throw away classmethod and staticmethod object. PyFunction can have binding flag instead, like METH_CLASS and METH_STATIC for PyCFunction. classmethod and staticmethod is just a function which modify the flag. But I'm not sure. Calling in Python is too complicated to fully understand. Regards, -- INADA Naoki <songofacandy@gmail.com>

My question is really: assuming that we redesign staticmethod/classmethod anyway, should we make them callable?
I think so. staticmethod and classmethod should affect descriptor behavior. And it should behave as normal function.
When Python 4, I think we can even throw away classmethod and staticmethod object. PyFunction can have binding flag instead, like METH_CLASS and METH_STATIC for PyCFunction. classmethod and staticmethod is just a function which modify the flag. But I'm not sure. Calling in Python is too complicated to fully understand. Regards, -- INADA Naoki <songofacandy@gmail.com>
participants (3)
-
INADA Naoki
-
Jeroen Demeyer
-
Random832