PEP318 yet an alternate syntax idea
Marco Aschwanden
PPNTWIMBXFFC at spammotel.com
Tue Mar 23 07:31:51 EST 2004
Python has the concept that names with a preceding underscores (__) will
be mangled in some way. I suppose the "compiler"/interpreter does this
name-mangling. Why not use the same concept:
def __static__theRealFunctionName(self, var1, var2):
pass
The compiler will do some name mangling. The function is called without
the __static__ part:
--> theRealFunctionName(3,4)
The advantages:
- Old code won't break (except if someone has functions starting with
__static__).
- It is an already used concept for "private" variables --> they might be
migrated to __private__
- well they even might be joined:
__static____privat__theRealFunctionName(...)
- don't use it if you don't need it (this probably defaults to a
__public__)
- The definition tells us what kind of method (class?) this is
The disadavantage:
- long names
Stupid idea? I guess so, but I am too stupid to see why?
Bye,
Marco
More information about the Python-list
mailing list