Re: [Pyobjc-dev] New version of Nib* from Just
Brought to you by:
ronaldoussoren
From: <bb...@ma...> - 2002-11-17 21:12:02
|
On Sunday, November 17, 2002, at 12:00 PM, Just van Rossum wrote: > I would suggest to always write it as: > > from AppKit.NibClassBuilder import extractClasses, AutoBaseClass > extractClasses("MainMenu") > class DeDatAppDelegate(AutoBaseClass, NSDraggingDestination): > .... > > This is how the generated template does it, too. (I somehow dislike > subclassing > from dotted names...) I agree regarding subclassing, but I don't like polluting the local namespace with things like 'extractClasses' as they give no indication as to where they came from the in the code. It is one thing to do 'from types import *' -- the types are all fairly specific in their naming and function -- but entirely a different thing to stick in something like extractClasses. So, I end up with this... from AppKit import NibClassBuilder from AppKit.NibClassBuilder import AutoBaseClass ... NibClassBuilder.extractClasses( "MainMenu" ) class DeDatAppDelegate(AutoBaseClass, NSDraggingDestination): .... ... which I don't like either, but does eliminate the dotted subclassing. > (Btw., regarding your recent mistake if subclassing from the NibLoader > _module_: > I was surprised that that actually _works_... It doesn't in 2.3a, > though, > although the error message is not exactly clear.) It didn't work and the error message was not at all clear. b.bum |