On 2012-06-19, at 4:17 PM, Jim Jewett wrote: >> I can tweak the PEP to make it more clear for those who don't know >> that staticmethods are not exactly methods, but do we really need that? > > I would prefer it, if only because it surprised me. When do > distinguish between methods, staticmethod isn't usually the odd man > out. > > And I also agree that the implementation doesn't need to change > (except to add a comment), only the PEP. Actually, it appears we don't need those special checks (for classmethod and staticmethod) at all. class Foo: @staticmethod def bar(): pass >>> Foo.bar <function bar ...> >>> Foo().bar <function bar ...> >>> Foo.__dict__['bar'] <staticmethod ...> So using the signature will be OK for 'Foo.bar' and 'Foo().bar', but not for 'Foo.__dict__['bar']' - which I think is fine (since staticmethod & classmethod instances are not callable) I'll just remove checks for static- and class-methods from the PEP signature() algorithm section. - Yury
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4