[Python-ideas] Documenting Python warts (original) (raw)

Mike Meyer mwm at mired.org
Wed Jan 2 07:04:24 CET 2013


Oleg Broytman <phd at phdru.name> wrote:

Well, some warts are quite well-known. My counter overflows when I try to count how many times anonymous code blocks have been proposed and rejected. IIRC Mr. van Rossum admitted that for/else was a design mistake.

As I recall it, that wasn't because they were a bad idea per se, but because the minor upside they provide isn't worth the confusion they create for newcomers.

But since we're referencing the BDFL, IIRC he isn't against anonymous code blocks (and I believe that is by far the most proposed/requested feature) per se. The proposals all seem to fail in one of three ways: 1) embedding them in expressions when indentation denotes block structure just invites unreadable code; 2) putting them in a separate block requires a name, and we already have def if the programmer provides it; or 3) providing an implicit name for a separate block isn't enough of a win to violate "explicit is better than implicit". There have been some let/where type suggestions, but those are more about namespaces than anonymous code blocks.

Sent from my Android tablet with K-9 Mail. Please excuse my swyping.



More information about the Python-ideas mailing list