classes (was Re: Same again please for OOP)
Alex Martelli
aleaxit at yahoo.com
Wed Dec 27 17:23:50 EST 2000
"D-Man" <dsh8290 at rit.edu> wrote in message
news:mailman.977952911.9681.python-list at python.org...
[snip]
> However, I can't get Alex's example code to work. I either get
> AttributeError or an infinitely recursive __getattr__. The reason is
> if I make a class Foo that has a function __get_value, the name is
> mangled to _Foo__get_value. If I reduce the leading underscores to
> only 1 underscore, it works fine.
>
> Have I missed something here Alex?
No, sorry, my fault -- two leading underscores without two trailing
ones do of course get mangled that way! 'Just one' works.
Alex
More information about the Python-list
mailing list