On 9/9/05, Guido van Rossum <guido at python.org> wrote: > > 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 > Yes. A straightforward solution... > 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. > I had that in mind when I wrote my post; changing types is not the way, that will not work. That is why I proposed __future__ (I really do not know very well the implementation details of that feature) because I think the parser/compiler can (magically) make the replacements, e.g. dict.items -> dict.iteritems for Py2.X series in codes *using* dicts . Do you think something like this could be implemented in a safer way? -- Lisandro Dalcín --------------- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) PTLC - Güemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4