The perfect Python
Erik Max Francis
max at alcyone.com
Wed Aug 28 15:29:08 EDT 2002
"Jean-François Ménard" wrote:
> What is missing ? Well, I'm not a language designer, but I can say
> what *I*
> miss.
>
> - Interfaces. Behavior checking is not enough.
This is something I think would be useful in some way, but I'm not sure
how to integrate it in a Pythonic way.
> - Private and Public scopes. Explicitly. No more __name_mangling
So what would private and public scopes get you that name mangling
wouldn't?
> - Design by contract. Pre and Post conditions. Could save hours
> of
> debugging.
Can't you do this yourself?
> - Block comments. """ """ should be for documentation.
You already have these.
> - Class variables.
You have these too:
class C:
N = 0
def __init__(self):
C.N += 1
The C.N counter is common to all instances.
> - No more self in functions declarations. In OOP, this *can* be
> implicit. (I know, this is controversial stuff)
This is a common request, but the problem in some cases the self
argument _can't_ be implicit. Take, for instance, bound vs. unbound
methods. Sometimes the self argument needs to be explicit.
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/ \ There is nothing so subject to the inconstancy of fortune as war.
\__/ Miguel de Cervantes
Church / http://www.alcyone.com/pyos/church/
A lambda calculus explorer in Python.
More information about the Python-list
mailing list