Jim Jewett wrote: > On 1/17/07, Thomas Wouters <[EMAIL PROTECTED]> wrote: >> On 1/16/07, Jim Jewett <[EMAIL PROTECTED]> wrote: >>> Other than dict.items (and .keys and .values) returning a non-list, >>> are there any other cases where the Py3K idiom can't already be used >>> in (or at least backported to) Py 2.x? > >> The aim for 2.6 should be to have all the new features that 3.0 has, >> as well as full backward compatibility ... > > And I'm asking if there are any real barriers to this. Some people > have suggested that they'll have to maintain separate code bases. So > far, the closest I've seen[1] to something that can't use > common-subset is wanting an iterator over a mapping.
To help with the transition code, could we have a 'py3migration' module that looked something like: if sys.version_info >= (3, 0, 0): from _py2compat import * else: from _py3compat import * By providing functions like dkeys(), ditems(), dvalues() and maybe a few others in that module, this could allow code that needs to work in both environments to be written, without causing significant pain to pure Python 2 code or to pure Python 3 code. OK, so it would mean there's still some backward compatibility cruft in Py3k, but one module seems a small price to pay for a single obvious way to handle semantic changes in the builtin APIs. Regards, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com