Thread: [Pyobjc-dev] setVerbose()
Brought to you by:
ronaldoussoren
From: Bill B. <bb...@co...> - 2003-01-02 05:02:20
|
The objc.setVerbose() "feels" like maybe it ought to be pushed down into a namespace of some kind. Namely, if I do... from objc imoprt * ... then setVerbose() is defined in the local namespace. setVerbose() is a potentially fairly common, non-ObjC specific, name. Maybe prefixing all bridge specific configuration functionality with pyobjc_? I.e. like objc_lookUpClass(), we have pyobjc_setVerbose()? b.bum |
From: Ronald O. <ous...@ci...> - 2003-01-02 19:12:51
|
On Thursday, Jan 2, 2003, at 04:48 Europe/Amsterdam, Bill Bumgarner wrote: > The objc.setVerbose() "feels" like maybe it ought to be pushed down > into a namespace of some kind. > > Namely, if I do... > > from objc import * Don't do that then ;-) I really mean that, the objc module is meant to be used with 'import objc' instead of 'from objc import *'. > ... then setVerbose() is defined in the local namespace. setVerbose() > is a potentially fairly common, non-ObjC specific, name. > > Maybe prefixing all bridge specific configuration functionality with > pyobjc_? > > I.e. like objc_lookUpClass(), we have pyobjc_setVerbose()? We have objc.lookUpClass and objc.setVerbose, 'objc.' as a prefix is just as much typing as 'objc_'. Adding the prefix therefore doesn't buy us much. Ronald |
From: Bill B. <bb...@co...> - 2003-01-02 21:24:19
|
On Thursday, Jan 2, 2003, at 14:11 US/Eastern, Ronald Oussoren wrote: > Don't do that then ;-) I really mean that, the objc module is meant to > be used with 'import objc' instead of 'from objc import *'. OK -- then, it is... import objc from objc import YES, NO ... for me, anyway. b.bum b.bum We gladly feast on those who would subdue us. |
From: Just v. R. <ju...@le...> - 2003-01-02 21:36:38
|
Bill Bumgarner wrote: > import objc > from objc import YES, NO > > .... for me, anyway. Can't Python's True and False (in 2.3 at least) be mapped to YES and NO? Just |
From: Bill B. <bb...@co...> - 2003-01-02 21:39:49
|
On Thursday, Jan 2, 2003, at 16:35 US/Eastern, Just van Rossum wrote: > Bill Bumgarner wrote: >> import objc >> from objc import YES, NO >> >> .... for me, anyway. > Can't Python's True and False (in 2.3 at least) be mapped to YES and > NO? Yes. And 1,0 work fine, as well, it seems. As of 10.2 (I believe), ObjC actually identifies (BOOL) as something separate from (char) in the method signatures. This will be an issue for the GnuStep folks unless that has been propagated back to GNU (it may have). b.bum |
From: Ronald O. <ous...@ci...> - 2003-01-03 06:55:23
|
On Thursday, Jan 2, 2003, at 22:16 Europe/Amsterdam, Bill Bumgarner wrote: > On Thursday, Jan 2, 2003, at 14:11 US/Eastern, Ronald Oussoren wrote: >> Don't do that then ;-) I really mean that, the objc module is meant >> to be used with 'import objc' instead of 'from objc import *'. > > OK -- then, it is... > > import objc > from objc import YES, NO > > ... for me, anyway. We could define __all__ in objc/__init__.py: __all__ = [ 'YES', 'NO', 'IBAction', 'IBOutlet' ] That would make it possible to do 'from objc import *' for accessing often used 'end-user' functionality, while keeping the namespace clean. Ronald |
From: Jack J. <Jac...@cw...> - 2003-01-03 13:30:51
|
On Friday, Jan 3, 2003, at 07:54 Europe/Amsterdam, Ronald Oussoren wrote: > We could define __all__ in objc/__init__.py: > > __all__ = [ 'YES', 'NO', 'IBAction', 'IBOutlet' ] > > That would make it possible to do 'from objc import *' for accessing > often used 'end-user' functionality, while keeping the namespace > clean. I think this is too magic. People expect "from xxx import *" to really import everything that is remotely useful. My vote would be for the {py}objc_ prefix to the methods, even though you then have to type objc.pyobjc_setVerbose() if you "import objc". Again with the same reasoning as last time: it communicates to the reader that it's useless to try and look up this function in Apple's documentation. -- Jack Jansen, <Jac...@cw...>, http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman |
From: Lele G. <le...@se...> - 2003-01-03 14:59:29
|
>>>>> On Fri, 3 Jan 2003 13:14:00 +0100, Jack Jansen <Jac...@cw...> said: JJ> On Friday, Jan 3, 2003, at 07:54 Europe/Amsterdam, Ronald JJ> Oussoren wrote: >> We could define __all__ in objc/__init__.py: >> >> __all__ = [ 'YES', 'NO', 'IBAction', 'IBOutlet' ] >> >> That would make it possible to do 'from objc import *' for >> accessing often used 'end-user' functionality, while keeping >> the namespace > clean. JJ> I think this is too magic. People expect "from xxx import *" JJ> to really import everything that is remotely useful. Uh? That syntax is deprecated since the BigBang. To be remotely useful, one has to know about it, and thus the "correct" form is to explicit its name. The "__all__" magic is to allow *the*developer* to export major "entry points" of the module, for lazy on-the-fly imports... JJ> My vote would be for the {py}objc_ prefix to the methods, even JJ> though you then have to type objc.pyobjc_setVerbose() if you JJ> "import objc". Again with the same reasoning as last time: it JJ> communicates to the reader that it's useless to try and look JJ> up this function in Apple's documentation. I'm with Ronald here: adding another prefix does not bring significant information, that by the way could be better explained by setVerbose.__doc__. ciao, lele. -- nickname: Lele Gaifax | Quando vivro' di quello che ho pensato ieri real: Emanuele Gaifas | comincero' ad aver paura di chi mi copia. email: le...@se... | -- Fortunato Depero, 1929. |