Eric Brunel a écrit :
> On Sun, 25 Feb 2007 22:12:52 +0100, Bruno Desthuilliers
> <[EMAIL PROTECTED]> wrote:
>
>> Steven W. Orr a écrit :
>>
>>> I understand that two leading underscores in a class attribute make
>>> the attribute private.
>>
>>
>> Nope. It doesn't make it "private", it mangle
On Sun, 25 Feb 2007 22:12:52 +0100, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> Steven W. Orr a écrit :
>> I understand that two leading underscores in a class attribute make the
>> attribute private.
>
> Nope. It doesn't make it "private", it mangles the attribute name with
> the class
Troy Melhase a écrit :
>> Why do people sometimes use one leading underscore?
>
>
> Many folks like to use the single leading underscore to emphasize that
> the attribute isn't part of the normal way to use the class or
> instance.
>
> It's bad style in my opinion, but I'm probably in the minori
Steven W. Orr a écrit :
> I understand that two leading underscores in a class attribute make the
> attribute private.
Nope. It doesn't make it "private", it mangles the attribute name with
the class name (ie : Bar.__mangled will become Bar._Bar__mangled
everywhere except inside Bar). This is
> If you say
>
> from foo import _fooa, _foob,
>
> then the import will fail because the _ is used only by the import to
> decide that you shouldn't see _fooa or _foob.
???
Read Python manuals, please.
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 23 Feb 2007 23:17:32 -0500, Steven W. Orr wrote:
> On Friday, Feb 23rd 2007 at 11:12 -0500, quoth Steven W. Orr:
>
> =>I understand that two leading underscores in a class attribute make the
> =>attribute private. But I often see things that are coded up with one
> =>underscore. Unless
On Friday, Feb 23rd 2007 at 11:12 -0500, quoth Steven W. Orr:
=>I understand that two leading underscores in a class attribute make the
=>attribute private. But I often see things that are coded up with one
=>underscore. Unless I'm missing something, there's a idiom going on here.
=>
=>Why do pe
On Feb 23, 5:12 pm, "Steven W. Orr" <[EMAIL PROTECTED]> wrote:
> I understand that two leading underscores in a class attribute make the
> attribute private. But I often see things that are coded up with one
> underscore. Unless I'm missing something, there's a idiom going on here.
>
> Why do peopl
En Fri, 23 Feb 2007 13:12:20 -0300, Steven W. Orr <[EMAIL PROTECTED]>
escribió:
> I understand that two leading underscores in a class attribute make the
> attribute private. But I often see things that are coded up with one
> underscore. Unless I'm missing something, there's a idiom going on he
On 2/23/07, James Stroud <[EMAIL PROTECTED]> wrote:
> Troy Melhase wrote:
> >> Why do people sometimes use one leading underscore?
> >
> >
> > Many folks like to use the single leading underscore to emphasize that
> > the attribute isn't part of the normal way to use the class or
> > instance.
> >
Troy Melhase wrote:
>> Why do people sometimes use one leading underscore?
>
>
> Many folks like to use the single leading underscore to emphasize that
> the attribute isn't part of the normal way to use the class or
> instance.
>
> It's bad style in my opinion, but I'm probably in the minority.
> Why do people sometimes use one leading underscore?
Many folks like to use the single leading underscore to emphasize that
the attribute isn't part of the normal way to use the class or
instance.
It's bad style in my opinion, but I'm probably in the minority.
--
http://mail.python.org/mailman/
I understand that two leading underscores in a class attribute make the
attribute private. But I often see things that are coded up with one
underscore. Unless I'm missing something, there's a idiom going on here.
Why do people sometimes use one leading underscore?
TIA
--
Time flies like the
13 matches
Mail list logo