Hi all,

I'm working on making pymake Python 3-compatible, while still
maintainin Python 2 support (work in progress here:
https://github.com/mozilla/pymake/)

I've addressed most minor issues, but there's two I don't feel
comfortable with: dict.iteritems() vs dict.items() and range vs.
xrange.

In Python 3, items(), keys() and values() on dict no longer return
lists, but rather lazy generators. The same goes for range(), it's now
lazy and assumes the behavior of Python 2's xrange(), which no longer
exists.

This is nice, except it makes cross-compatible code much harder, since
all functions exist in both Python versions but have very different
semantics.

I'm guessing you won't like the Python 2 code to always use eager
items, keys, value and range, because it would take its toll on memory
consumption and unnecessary copies.

Do you have any ideas for version-agnostic patterns?

Thanks,
- Kim
_______________________________________________
dev-builds mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-builds

Reply via email to