Re: [Pyobjc-dev] [ pyobjc-Bugs-836247 ] NSWindow.contentRectForFrameRect_styleMask_ not a class meth
Brought to you by:
ronaldoussoren
From: Bob I. <bo...@re...> - 2003-11-05 22:44:27
|
On Nov 5, 2003, at 5:24 PM, Jack Jansen wrote: > On 5-nov-03, at 17:26, Bob Ippolito wrote: > >> >> On Nov 5, 2003, at 5:00 AM, Ronald Oussoren wrote: >> >>> NSObject.foo() # Instancemethod, or if that does not exist >>> classmethod >>> NSObject.pyobjc_classMethods.foo() # Classmethod >>> NSObject.pyobjc_instanceMethods.foo() # Instancemethod >> >> Another idea - how about putting that on the selector instead? >> >> NSObject.foo() # smart decision by the selector (smarter than >> instance if it has one, see previous email) >> NSObject.foo.classMethod() # classmethod >> NSObject.foo.instanceMethod() # instanceMethod > > That would make "NSObject.foo" a funny sort of object. In the current > scheme NSObject.foo is a perfectly normal object, either an unbound > method or a class method. Except that it has a signature, isClassMethod, etc. It's not a perfectly normal object, it's a selector instance. One of the big "selling points" of ObjC is that you can pretty much translate ObjC code to Python, this is a stumbling block I think we should work around. With the "algorithm" I posted earlier, using these special "classMethod / instanceMethod" accessors should never really be necessary, except in rare instances where you are doing SomeClass.someInstanceMethod(instance, ...) with varargs or something. -bob |