[Python-Dev] Python-3000 upgrade path

Guido van Rossum guido at python.org
Mon Mar 12 19:13:28 CET 2007


Absolutely right. I'll withdraw the lightweight version. It's done
enough damage.

On 3/11/07, Andrew McNamara <andrewm at object-craft.com.au> wrote:
> >I wrote two versions of the dict views refactoring. One that turns
> >d.keys() into list(d.keys()) and d.iterkeys() into iter(d.keys()).
> >This one is pretty robust except if you have classes that emulate
> >2.x-style dicts. But it generates ugly code. So I have a
> >"light-weight" version that leaves d.keys() alone, while turning
> >d.iterkeys() into d.keys(). This generates prettier code but more
> >buggy. I probably should have used the heavy-duty one instead.
>
> The ugliness is a virtue in this case as it stands out enough to motivate
> developers to review each case. The pretty/efficient version is tantamount
> to guessing, and effectively discards information in the transformation
> ("here be dragons").
>
> --
> Andrew McNamara, Senior Developer, Object Craft
> http://www.object-craft.com.au/
>


-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list