[Python-Dev] Common subset of python 2 and python 3 (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Wed Jan 15 15:34:24 CET 2014
- Previous message: [Python-Dev] Common subset of python 2 and python 3
- Next message: [Python-Dev] Common subset of python 2 and python 3
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, 15 Jan 2014 16:31:17 +0200 Serhiy Storchaka <storchaka at gmail.com> wrote:
15.01.14 14:22, "Martin v. Löwis" написав(ла): > 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? > > Notice that it prints "True" in Python 2 and "False" in Python 3.
This is implementation details. On 128-bit platform special build of Python 2 can print False.
If you explicitly create a long the L will always be printed:
long(0) 0L
Regards
Antoine.
- Previous message: [Python-Dev] Common subset of python 2 and python 3
- Next message: [Python-Dev] Common subset of python 2 and python 3
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]