PEP318 yet an alternate syntax idea
michele.simionato at poste.it
Tue Mar 23 19:44:02 CET 2004
Marco Aschwanden <PPNTWIMBXFFC at spammotel.com> wrote in message news:<mailman.277.1080045041.742.python-list at python.org>...
> 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):
> 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
> - It is an already used concept for "private" variables --> they might be
> migrated to __private__
> - well they even might be joined:
> - don't use it if you don't need it (this probably defaults to a
> - 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?
1. it is ugly;
2. you don't need to change the core language for that. Implementing
this idea in Python 2.2+ is just an exercise in metaclasses. It
does not deserve a PEP.
3. How do you pass parameters to the decorator?
More information about the Python-list