Re: Question about idiomatic use of _ and private stuff.

2007-02-27 Thread Bruno Desthuilliers
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

Re: Question about idiomatic use of _ and private stuff.

2007-02-26 Thread Eric Brunel
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

Re: Question about idiomatic use of _ and private stuff.

2007-02-25 Thread Bruno Desthuilliers
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

Re: Question about idiomatic use of _ and private stuff.

2007-02-25 Thread Bruno Desthuilliers
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

Re: Question about idiomatic use of _ and private stuff.

2007-02-23 Thread goodwolf
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

Re: Question about idiomatic use of _ and private stuff.

2007-02-23 Thread Gabriel Genellina
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

Re: Question about idiomatic use of _ and private stuff.

2007-02-23 Thread Chris Mellon
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. > >

Re: Question about idiomatic use of _ and private stuff.

2007-02-23 Thread James Stroud
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.

Re: Question about idiomatic use of _ and private stuff.

2007-02-23 Thread Troy Melhase
> 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/