A really bad idea.
Daniel Dittmar
daniel at dittmar.net
Fri Nov 15 15:46:24 EST 2002
sismex01 at hebmex.com wrote:
>>From: Daniel Dittmar [mailto:daniel.dittmar at sap.com]
>>zip, enumerate: readable, because you can search the docs for
>>the words. It is also easy to implement variations: returning
>>other datatypes, returning an iterator to preserve memory. Thus
>>the whole program becomes easier to understand because similar
>>task are called in a similar way.
>>
>>list comprehension: not readable, because you don't know what to
>>search for. You can't create dictionary comprehension or generator
>>comprehension (both have been proposed on c.l.p), thus making the
>>resulting program less regular.
> But these are your *opinions*.
No. These are criteria (or whatever the plural of criterion is),
although of course there isn't a strict line between 'readable' and 'not
readable'. Most Python programmers will agree that putting something
into a library is generally a better choice than inventing a new syntax.
Where some disagree is if building a list is so common that a new syntax
makes the code actually more readable because the intentions are more
explicit.
> And while valid, others on the
> same list (or lists) have expressed nothing but rave reviews on
> the same things you don't like.
True. But the initial posters concern was that if more of these features
make it into Python, than a specific quality and a specific user group
(the casual Python programmer) may be lost.
Occasionally I have to change a Perl script, so I know what it is like
if you can't look something up by a keyword.
> So, what to do?
> Macros, a-la Lisp, so anyone can have whatever syntax they want?
> A mishmash of features, like Perl?
Or perhaps nothing?
Daniel
More information about the Python-list
mailing list