Idea about method parameters
markus at schabi.de
Wed Sep 26 21:47:47 CEST 2001
Tom Loredo <loredo at astro.cornell.edu> schrub:
>> And this is exactly why I begun this discussion here. I wanted to
>> know whether there are more (enough) programmers that will like it,
>> what bad side effects it has, and whether it is worth any effort.
> I tend to be very conservative about changes to Python, but I have to
> confess that this one I do like. Its syntax is obvious and
> seems to me to be cleaner and more controlled
> than Wolfgang's (admittedly clever) __dict__ approach; in particular,
> it would catch misspellings (if the use used a keyword that wasn't
> in the argument list).
Yes, it is a clever solution, and works for most of the cases, great
But it doesn't work well if you only want to assign some of the
parameters, and it leaves the variable dictionary polluted (although it
is clear that those bindings are done).
> I'm still waiting to learn of any bad side effects....
I hope there aren't any :-)
The syntax I propose was invalid before, so it should not break any
existing code, and the semantics are expressable in clean, normal
python code (even preprocessor-like), so it should be compatible with
every usage of so defined methods.
"The strength of the Constitution lies entirely in the determination of
each citizen to defend it. Only if every single citizen feels duty
bound to do his share in this defense are the constitutional rights
secure." -- Albert Einstein
More information about the Python-list