[Python-Dev] Common subset of python 2 and python 3

Eric V. Smith eric at trueblade.com
Wed Jan 15 15:25:04 CET 2014


On 1/15/2014 8:21 AM, Chris Angelico wrote:
> On Wed, Jan 15, 2014 at 11:22 PM, "Martin v. Löwis" <martin at v.loewis.de> wrote:
>> I don't think that it is possible to write an interpreter that is fully
>> compatible for all it accepts. Would you think that the program
>>
>> print(repr(2**80).endswith("L"))
>>
>> is in the subset that should be supported by both Python 2 and Python 3?
> 
> Easiest fix for that would be to have long.__repr__ omit the L tag.
> Then it'll do the same as it would in Py3.

I think Martin's point is not this specific thing, but that such a
subset would be useless. Would you drop dict.items() because it returns
different things in both languages? Drop range() because it's different?
There are many, many such differences. The common subset is not useful.

Eric.



More information about the Python-Dev mailing list