Re: [Pyobjc-dev] Customizing trouble with NSCell & NSTableView
Brought to you by:
ronaldoussoren
From: Bill B. <bb...@ap...> - 2003-05-20 21:04:13
|
On Tuesday, May 20, 2003, at 13:23 US/Pacific, Jack Jansen wrote: > Is there any way we could catch this? The runtime system does notice > that it doesn't have a signature for the message it is going to be > calling, so it could complain (I assume). I am tempted to say that > calling a Python method without a signature is a bug, and we should > simply give an error, or are there any normal use cases of calling > Python methods without the signature? If so, then could we somehow > notify the user of this situation with a (suppressible) warning? Given that it is generally a bad idea to create two methods with the same name but different signatures (different type arguments), we could gather all of the methods declared in informal protocols into a big hash (method name key, set of protocols as value). Then, a validation step could look at all of the methods on a class and see if any appear in an informal protocol and a warning could be issued in appropriate circumstances. This would be expensive enough that it doesn't make sense to do it all the time (I wouldn't think), but it would be very handy in the development environment. The validation could be triggered by an NSUserDefault -- say, "PyObjCDebuggingEnabled" (to follow from other patterns in WebObjects and Cocoa -- and, as such, could be enabled by simply passing '-PyObjCDebuggingEnabled YES' to the app from the command line (or writing the value to the defaults). b.bum |