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

Paul Boddie paul at boddie.net
Wed Apr 10 09:52:44 EDT 2002


Alex Martelli <aleax at aleax.it> wrote in message news:<RYTs8.2219$b62.57325 at news1.tin.it>...
> 

[Iterators]

> I've noticed they immensely help Python beginners that come to them
> without preconcepts.  Such beginners are surprised to learn that
> these are extremely recent additions to Python, so well they fit in.

Well, I was excited a few years ago when iterators appeared in C++, so
I suppose I should be even more excited now. :-) However, it's
arguably a bigger deal for the implementer of the iterator (or
generator, even) than the "users" or "clients" of them. Many beginners
just expect things to work in the way that iterators themselves
promote, and it was previously up to the implementer of a framework to
provide nice interfaces to "users"/"clients" - now, it's just easier
for the implementer.

[...]

> They're great progress over the previously murky "iteration protocol".

What protocol was that again? ;-)

[Applications which subclass built-in types]

> Or maybe not being used to them you just don't think of cases where
> they'd be handy (if you need to keep compatibility with 2.1, then
> of course you'd better NOT start thinking of such cases:-).  I.e.,
> Sapir-Whorf hypothesis somewhere between its weakest and strongest
> forms (though I still prefer the way Wittgenstein independently
> put it earlier -- "The limits of my language are the limits of
> my world").

It's probably best not to bring semi-controversial linguistic themes
into the discussion - Whorf allegedly had less of a grasp of the
languages he used to illustrate his hypothesis than I do of the most
recent Python features. ;-)

Seriously, I can't think of cases off the top of my head where
inheriting from an integer, floating point, complex number, string,
tuple, list or dictionary are so compelling. An "ordered dictionary"
can be useful, but we already had UserDict to define the interface for
that kind of thing.

[New features in the tutorial]

> Yes, just not in the tutorial (at least not until they're in the
> "current" language rather than needing import from the future).

That's part of my original argument, though. I get the impression that
some packages not only require Python 2.2 because they use new,
standard features, but also so that the author can drag users further
into the future by making use of not-yet-standard features, if only
for their own entertainment.

[...]

> AMK's mission is not to tell you WHY you can be interested in
> major stuff such as subclassing builtins, iterators, generators,
> though -- just to ensure you DO know easily what IS new.

It wouldn't be a bad thing to have such a source of brief rationales
for new features, however.

Paul



More information about the Python-list mailing list