Re: [Pyobjc-dev] Underscores in methods/instance variables
Brought to you by:
ronaldoussoren
|
From: Petr M. <pet...@an...> - 2009-03-28 23:32:56
|
Hi, I made some more digging into this matter and the only thing I found so far is this one (sorry, a long one): http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/CodingGuidelines/Articles/NamingMethods.html#//apple_ref/doc/uid/20001282-1003829-BCIBDJCA and some good insights here: http://www.cocoadev.com/index.pl?CodingGuidelines So unless anybody knows and posts more profound answer, I suggest that the paragraph in the PyObjC intro stating """...instance variables prefixed with underscores are reserved by the Objective-C runtime...""" was put there based on the Apple's recommendation of not using such variables. Cheers, Petr Orestis Markou wrote: > Hello all, > > I want to clarify a bit the advice of the documentation to *not* use > the Python conventions of not using leading underscores for "private" > instance attributes. > > Is it the danger of accidentally overwriting some other Obj-C > attribute if there's a name clash? What about methods with leading > underscores? > > I fully understand that in order a method to be accessible from Obj-C > code it has to follow the methodWithArg_andArg_(self, arg1, arg2) > convention. In my case, these are "private" methods that I have no > desire to expose to anyone. > > The class in question is just a delegate that implements a custom init > method and the delegate method. These are the only things that use the > obj-c convention. The rest of the code is using the Python convention, > with leading underscores in attributes and methosd, property > decorators and so on. > > Testing indicates that things are working perfectly fine, I'm just > worried that there may some stability issues that may not visible at > this point. I've heard rumours of hard crashes that may have been > related to this, so I'm a bit worried. > > Thanks, > Orestis > -- > or...@or... > http://orestis.gr/ > > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |