The whitespaceless frontend

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Tue Apr 25 06:15:20 EDT 2006


Stelios Xanthakis:

>in my opinion nested functions are not so important and I wouldn't spend any time to improve them. Usually you can do anything with classes<

Some people like and use them often (like those ones coming from
Pascal-like languages, etc), some other people (like those coming from
C-like languages like Java) use them rarely and like classes more.
Python can choose to have just one way to solve such problems, or to
support both kinds of people. At the moment I think it tries to please
both kind of programmers.


>'$' being unused seems like a good choice.<

It's less explicit than self. but it's shorter, this improves typing,
and allows to produce more compact code:

return "".join(["Graph(", repr($o), ", ", repr($nodeData), ")"])

Instead of:

return "".join(["Graph(", repr(self.o), ", ", repr(self.nodeData),
")"])

But note that every time you want to add a new piece of syntax you must
think if the same syntax can be more useful for more common tasks (like
string substitution/templating, in this situation).


> - sorry for the delayed reply. Unexpected easter vacation.<

No problem.

Bye,
bearophile




More information about the Python-list mailing list