On 9/10/05, Lisandro Dalcin <dalcinl at gmail.com> wrote: > On 9/9/05, Guido van Rossum <guido at python.org> wrote: > > 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? Please trust me. It can't be made to work. The compiler doesn't know the types of the variables so it doesn't know whether in a particular occurrence of the expression 'x.items", x is a dict or not. -- --Guido van Rossum (home page: http://www.python.org/~guido/)
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