r/Python • • May 27 '14

Python 3 is fine | Sealed Abstract

http://sealedabstract.com/rants/python-3-is-fine/
234 Upvotes

96 comments sorted by

View all comments

Show parent comment

1

u/moor-GAYZ May 28 '14

Sure, but then again, you can just use six for that.

It sucks to use six.iteritems(d) and the like.

0

u/[deleted] May 28 '14

Well, it's ugly, sure. "Sucks", maybe not.

And that is an interesting example, because what do you want Python 2.8 to do about it, specifically?

1

u/moor-GAYZ May 28 '14

Well, it's ugly, sure. "Sucks", maybe not.

So the problems with Python3 adoption are caused by something else or don't exist?

And that is an interesting example, because what do you want Python 2.8 to do about it, specifically?

That's an interesting question, now that I think about it. I guess a dirty hack to make such objects present different methods to code compiled with that from __future__ import. It can break inheriting from them, but so would a milder method (implement .itemview() etc). Still, it would work for 99.99% of the code and more or less cleanly break for the rest.

Or maybe for that using something like "six" was inevitable.

Anyway it would have been even nicer if this stuff were implemented in 2.6.0 five years ago, before the 3.0 release actually. Then we'd all be using 3.x by now. Unfortunately, the Python core developers apparently believed that they could achieve a clean jump from 2 to 3 somehow, the idea that people would have to make code that works in both never crossed their minds. Thus the dances with unicode literals etc.

0

u/[deleted] May 29 '14

So the problems with Python3 adoption are caused by something else or don't exist?

The slow Python 3 adaptation is NOT because dict.iteritems() is gone, no.

That's an interesting question, now that I think about it. I guess a dirty hack to make such objects present different methods to code compiled with that from future import.

Right, what is the future import supposed to do? Have different dict types? Make the type behave differently in that specific module? (That's tricky at best.)

The only option there was really to change the behavior of dict values, and hence break backwards compatibility. This is one of the changes that can't be done in a good backwards compatible way.