[Python-Dev] Object customization (was: Arbitrary attributes on funcs and methods)

Skip Montanaro skip@mojam.com (Skip Montanaro)
Fri, 14 Apr 2000 17:00:30 -0500 (CDT)


Barry said "_" is effectively taken because it means something (at least when 
used a function?) to pygettext.  How about "__" then? 

    def bar():
       print __.x
    def foo():
       print __.x
    foo.x = "public"
    bar.x = "private"
    ...

It has the added benefit that this usage adheres to the "Python gets to
stomp on __-prefixed variables" convention.

my-underscore-key-works-better-than-yours-ly y'rs,

Skip