Re: Private variables

2010-09-01 Thread Rasjid Wilcox
On 2 September 2010 12:22, Ryan Kelly wrote: > On Thu, 2010-09-02 at 12:06 +1000, Ryan Kelly wrote: >> On Thu, 2010-09-02 at 11:10 +1000, Rasjid Wilcox wrote: >> > Hi all, >> > >> > I am aware the private variables are generally done via convention >> > (leading underscore), but I came across a te

Re: Private variables

2010-09-01 Thread Ryan Kelly
On Thu, 2010-09-02 at 12:06 +1000, Ryan Kelly wrote: > On Thu, 2010-09-02 at 11:10 +1000, Rasjid Wilcox wrote: > > Hi all, > > > > I am aware the private variables are generally done via convention > > (leading underscore), but I came across a technique in Douglas > > Crockford's book "Javascript:

Re: Private variables

2010-09-01 Thread Ryan Kelly
On Thu, 2010-09-02 at 11:10 +1000, Rasjid Wilcox wrote: > Hi all, > > I am aware the private variables are generally done via convention > (leading underscore), but I came across a technique in Douglas > Crockford's book "Javascript: The Good Parts" for creating private > variables in Javascript,

Re: private variables

2007-01-09 Thread Gabriel Genellina
At Tuesday 9/1/2007 04:38, belinda thom wrote: I knew it was a beehive, but I had hoped someone would know which version they were released, so I can put the proper statement into my tutorial (e.g. In version , Python provided some support for private variables...). I've been avoiding getting st

Re: private variables

2007-01-09 Thread belinda thom
On Jan 9, 2007, at 12:20 AM, Bruno Desthuilliers wrote: > belinda thom a écrit : >> Hello, >> >> In what version of python were private variables added? > > Which private variables ? Haha. The ones that are provided for convenience (via name mangling) that aren't really private if you wish to

Re: private variables

2007-01-09 Thread Bruno Desthuilliers
belinda thom a écrit : > Hello, > > In what version of python were private variables added? Which private variables ? -- http://mail.python.org/mailman/listinfo/python-list

Re: private variables

2007-01-08 Thread belinda thom
I knew it was a beehive, but I had hoped someone would know which version they were released, so I can put the proper statement into my tutorial (e.g. In version , Python provided some support for private variables...). I've been avoiding getting stung b/c I see both sides and have no prefe

Re: private variables

2007-01-08 Thread Ravi Teja
belinda thom wrote: > Hello, > > In what version of python were private variables added? > > Thanks, > > --b Short answer - 1.5 (or - so long ago that it doesn't matter anymore) Long answer - There are no true private variables in Python. Just private variables names by convention. See Python do

Re: private variables

2007-01-08 Thread Thomas Ploch
belinda thom schrieb: > Hello, > > In what version of python were private variables added? > > Thanks, > > --b > With this question you stepped into a bee hive. :-) Read the 'Why less emphasis on private data?' thread. But I can't tell you, when this so called 'private variables' were added.

Re: "private" variables a.k.a. name mangling (WAS: What is print? A function?)

2005-01-25 Thread Steven Bethard
Toby Dickenson wrote: I have a counterexample. Consider refactoring a class from class B(A): etc into class C(A): etc class B(C): etc Usage of some double-undescore attributes moved from B to the new intermediate base class C. Unit tests on B still passed, so that change is

Re: "private" variables a.k.a. name mangling (WAS: What is print? A function?)

2005-01-25 Thread Richie Hindle
[Toby] > The problem occured because the double-underscore mangling uses the class > name, but ignores module names. A related project already had a class named C > derived from B (same name - different module). Yikes! A pretty bizarre case, but nasty when it hits. I guess the double-undersc

Re: "private" variables a.k.a. name mangling (WAS: What is print? A function?)

2005-01-25 Thread Philippe C. Martin
Well I _was_ a bit slow on that one ! So I will happily stick to the double underscore. Regards, Philippe Le mardi 25 janvier 2005 Ã 10:28 +, Simon Brunning a Ãcrit : > On Mon, 24 Jan 2005 12:17:13 -0600, Philippe C. Martin > <[EMAIL PROTECTED]> wrote: > > > > I use "__"for private varia

Re: RE:"private" variables a.k.a. name mangling (WAS: What is print? A function?)

2005-01-25 Thread Sion Arrowsmith
Jeremy Bowers <[EMAIL PROTECTED]> wrote: > [ ... ] the Python community, and in general the dynamic language >community, has become increasingly confident that private variables don't >solve *real* problems. Years of writing and maintaining others' C++ and Java code (plus one year of maintaining

Re: "private" variables a.k.a. name mangling (WAS: What is print? A function?)

2005-01-25 Thread Toby Dickenson
On Tuesday 25 January 2005 12:40, Richie Hindle wrote: > > [Steven] > > Can someone give me an example of where __-mangling really solved a problem > > for them, where a simple leading underscore wouldn't have solved the > > same problem? > > http://cvs.sourceforge.net/viewcvs.py/spambayes/sp

Re: "private" variables a.k.a. name mangling (WAS: What is print? A function?)

2005-01-25 Thread Richie Hindle
[Steven] > Can someone give me an example of where __-mangling really solved a problem > for them, where a simple leading underscore wouldn't have solved the > same problem? http://cvs.sourceforge.net/viewcvs.py/spambayes/spambayes/spambayes/Dibbler.py?r1=1.13&r2=1.13.4.1 That's a bugfix to Sp

Re: "private" variables a.k.a. name mangling (WAS: What is print? A function?)

2005-01-25 Thread michele . simionato
>Name mangling is there to keep you from accidentally hiding such an >attribute in a subclass, but how often is this really a danger? Can >someone give me an example of where __-mangling really solved a problem >for them, where a simple leading underscore wouldn't have solved the >same problem? Lo

Re: "private" variables a.k.a. name mangling (WAS: What is print? A function?)

2005-01-25 Thread Simon Brunning
On Mon, 24 Jan 2005 12:17:13 -0600, Philippe C. Martin <[EMAIL PROTECTED]> wrote: > > I use "__"for private variables because I must have read on net it was > the way to do so - yet this seems to have changed - thanks: > > http://www.network-theory.co.uk/docs/pytut/tut_77.html Nope, that's still

Re: Why I use private variables (WAS: RE:"private" variables a.k.a. name mangling?)

2005-01-24 Thread Steven Bethard
Philippe C. Martin wrote: I used double underscore because I thought it was the correct way to name private variables/methods - I will have to change those to single underscore since that it the current methodology. A private variable to me: 1) is internal to the processing of a class and needs not

RE: Why I use private variables (WAS: RE:"private" variables a.k.a. name mangling?)

2005-01-24 Thread Philippe C. Martin
I used double underscore because I thought it was the correct way to name private variables/methods - I will have to change those to single underscore since that it the current methodology. A private variable to me: 1) is internal to the processing of a class and needs not be accessed by external

RE: Why I use private variables (WAS: RE:"private" variables a.k.a. name mangling?)

2005-01-24 Thread Jeremy Bowers
On Mon, 24 Jan 2005 15:35:11 -0600, Philippe C. Martin wrote: > The real reason behind my using private variables is so they do not appear > in the epydoc generated documentation and confuse my users. You mean single or double underscores? I just checked and at least epydoc 2.1 doesn't include si

RE: Why I use private variables (WAS: RE:"private" variables a.k.a. name mangling?)

2005-01-24 Thread Philippe C. Martin
The real reason behind my using private variables is so they do not appear in the epydoc generated documentation and confuse my users. Regards, Philippe -- *** Philippe C. Martin SnakeCard LLC www.snakecard.com *** -- http://mail.python.org/m

Re: RE:"private" variables a.k.a. name mangling (WAS: What is print? A function?)

2005-01-24 Thread Jeremy Bowers
On Mon, 24 Jan 2005 12:17:13 -0600, Philippe C. Martin wrote: > I use "__"for private variables because I must have read on net it was the > way to do so - yet this seems to have changed - It's still as true as ever, at least in terms of language support, it's just that the Python community, and

RE:"private" variables a.k.a. name mangling (WAS: What is print? A function?)

2005-01-24 Thread Philippe C. Martin
I use "__"for private variables because I must have read on net it was the way to do so - yet this seems to have changed - thanks: http://www.network-theory.co.uk/docs/pytut/tut_77.html As far as the specific stderr reroute example - I just grabbed some of my code and forgot to get rid of that