On 9/9/05, Lisandro Dalcin <[EMAIL PROTECTED]> wrote: > PEP 3000 says > (http://www.python.org/peps/pep-3000.html) : > > Core language > - Return iterators instead of lists where appropriate for atomic type > methods (e.g. dict.keys(), dict.values(), dict.items(), etc.) > > Built-in Namespace > - Make built-ins return an iterator where appropriate (e.g. range(), > zip(), etc.) > - Relevant functions should consume iterators (e.g. min(), max()) > To be removed: > - xrange(): use range() instead [1] > > Any possibility to add one (or more) __future__ statement to > implicitly get this behavior? Any suggestion about naming?
For the builtins, it would actually be possible to do this by simply importing an alternate builtins module. Something like from future_builtins import min, max, zip, range For methods on standard objects like dicts it's not really possible either way; the type of a dict is determined by the module containing the code creating it, not the module containing the code using it. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com