[Python-Dev] Backporting PEP 3127 to trunk

Eric Smith eric+python-dev at trueblade.com
Fri Feb 22 22:42:32 CET 2008


Robert Brewer wrote:
> Eric Smith wrote:
>> Robert Brewer wrote:
>>> Postgres bytea coercion is a frequent use case for oct() in my
> world.
>>> But I agree we don't need two versions.
>> Unless you're trying to write code to work with both 2.6 and 3.0.
> 
> Who would try that when PEP 3000 says (in bold type no less):
> 
>     There is no requirement that Python 2.6 code will run unmodified
>     on Python 3.0. Not even a subset.
> 
> ?

Yes, but it also describes the "recommended development model for a 
project that needs to support Python 2.6 and 3.0 simultaneously".  That 
is to run 2to3 on 2.6 code (which is -3 clean), and not edit the 
resulting code.  I'm trying to enable that for code which wants to use 
some (small) 3.0 features.  I don't see the harm in that.

I think this means that the existing oct and hex builtins should raise a 
-3 warning.  The future_builtins version would not raise a warning.

Eric.


More information about the Python-Dev mailing list