[Python-Dev] why different between staticmethod and classmethod on non-callable object?
Benjamin Peterson
benjamin at python.org
Wed Sep 2 00:31:26 CEST 2009
More information about the Python-Dev mailing list
Wed Sep 2 00:31:26 CEST 2009
- Previous message: [Python-Dev] why different between staticmethod and classmethod on non-callable object?
- Next message: [Python-Dev] why different between staticmethod and classmethod on non-callable object?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
2009/9/1 Greg Ewing <greg.ewing at canterbury.ac.nz>: > Brett Cannon wrote: >> >> It isn't like it is checking >> explicitly for a function or method, just that it can be called which >> seems reasonable to me (unless PyCallable_Check() is as off as >> callable() was). > > I think it just checks that there's something in the > tp_call slot, which is reasonable -- if it's empty, > there's no way that calling the object could ever > succeed, so you might as well fail early. It depends on whether you're keeping the "callable" object around or not. Somebody could add a __call__ method later. -- Regards, Benjamin
- Previous message: [Python-Dev] why different between staticmethod and classmethod on non-callable object?
- Next message: [Python-Dev] why different between staticmethod and classmethod on non-callable object?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list