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
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:
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,
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
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
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
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
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
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.
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
[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
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
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
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
[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
>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
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
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
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
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
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
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
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
23 matches
Mail list logo