Re: [Pyobjc-dev] Running tests in one python session
Brought to you by:
ronaldoussoren
From: <bb...@ma...> - 2003-05-29 21:52:45
|
>> Posing also introduces another, possibly more serious, problem: If >> someone poses as NSObject after you import Foundation, >> Foundation.NSObject still references the original NSObject (which is >> now %NSObject). This can be fixed for 'import Foundation', but not >> for 'from Foundation import *'. Sadly enough the latter is how most >> peoply import the module. This problem is universal to ObjC and generally fatal in the context of the Java/ObjC bridge. In general, if the developer is going to do any posing, that posing should *always* be done before a class is used at all (beyond triggering +initialize and +load, obviously). Any other use of the class that results in instantiation or permanent references to the class will cause problems. That PyObjC can fix the problem in any case puts PyObjC beyond the capabilities of the default runtime! Bottom line: posing is always problematic. If the developer is going to use posing, the limitation that it must be done before a reference to the class is created is nothing new. Attempting to automatically fix the references to the old class after posing is a feature request, not a bug fix. ;-) b.bum |