Booleans, integer division, backwards compatibility; where is Python going?

Alex Martelli aleax at aleax.it
Tue Apr 9 10:20:44 EDT 2002


Paul Boddie wrote:
        ...
> sentiments.) However, I do feel that the more recent features seem
> increasingly remote to the beginner and even the more

This can only come from a very selective view of "recent features".

Nothing is more natural to a beginner than "if x in somedict:" and
"for x in thefile:" -- having had the opportunity to teach some
beginners with 2.2, I've seen them slurp these up instantly (just
try to contrast with "if somedict.has_key(x):" and
"for x in thefile.xreadlines():" ...!).  And the new features are
the right way to implement such obvious progress -- iterators, for
example, let you loop on (e.g.) dictionaries or files, without
requiring such types to define unnatural (or unfeasible) "indexing"
then go out of their way to stop misuse.

> advanced/experienced Python developer.

You MUST be joking -- inheriting from builtin types is SUCH a win,
and so obviously so, for advanced and experienced developers! 

> List comprehensions (introduced
> in 2.0) do appear in the standard tutorial, but I can't easily find
> generators, even though they are documented in the language reference.

Generators need a "from __future__ import", so I applaud the tutorial's
choice not to burden beginners with them YET.

> other things to do during working hours) it becomes increasingly hard
> to keep track of what's great in the more recent Python releases.

I think AMK's "what's new" articles are great for that purpose.



Alex




More information about the Python-list mailing list