[Python-Dev] Clarify the compatibility policy of lib2to3.

Guido van Rossum guido at python.org
Fri Nov 17 14:29:25 EST 2017


On Fri, Nov 17, 2017 at 8:56 AM, Dong-hee Na <donghee.na92 at gmail.com> wrote:

> Few days ago, I submitted a patch(https://github.com/
> python/cpython/pull/4417) which updates2to3 converts
> `operator.isCallable(obj)` to `isinstance(obj, collections.abc.Callable)`.
>
> This was Serhiy Storchaka’s idea(https://bugs.python.org/issue32046) and
> I agree with his idea since `callable` is not available in all 3.x versions.
>
> However, some people would like to clarify the policy of 2to3.
> That means that 2to3 is compatible with the branch that is currently
> maintained? or it is converted to specific Python 3.X codes with the
> specific version of 2to3?
>

Ideally it would generate code that works under all *still supported*
versions of Python, not just under the version that happens to be used to
run the converter. In the context of that specific bug, callable() appeared
in Python 3.2, but the oldest Python 3 version that's still supported is
3.4, so we're safe generating callable().

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20171117/f3c2787f/attachment.html>


More information about the Python-Dev mailing list