Re: [Pyobjc-dev] How to do isKindOfClass:? (and a bug fix)
Brought to you by:
ronaldoussoren
From: Bill B. <bb...@co...> - 2002-10-17 20:11:39
|
Doesn't appear to work either -- likely because we both reversed the arguments... :-) >>> isinstance(d, NSDictionary) 1 (This was what I was originally going to send) [bumbox:V3/OSX-Desktop/Intent] bbum% python Python 2.2 (#1, 07/14/02, 23:25:09) [GCC Apple cpp-precomp 6.14] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from Foundation import * >>> d = NSMutableDictionary.dictionary() >>> d <NSCFDictionary objective-c instance 0x161ae0> >>> isinstance(NSDictionary, d) Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: isinstance() arg 2 must be a class or type >>> isinstance(NSDictionary, type(d)) 0 >>> isinstance(NSDictionary, d.__class__) 0 >>> d <NSCFDictionary objective-c instance 0x161ae0> thanks! On Thursday, October 17, 2002, at 04:45 AM, Ronald Oussoren wrote: > You can do 'isinstance(NSDictionary, mD)'. > > I'd expect that isKindOfClass: also works, I'll look into why it > doesn't. > > Ronald |