6
$ ./pypy -O
Python 2.7.2 (a3e1b12d1d01, Dec 04 2012, 13:33:26)
[PyPy 1.9.1-dev0 with GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: `` amd64 and ppc are only
available in enterprise version''
>>>> assert 1==2
Traceback (most recent call last):
  File "", line 1, in 
AssertionError
>>>> 

But when i execute

$ python -O
Python 2.7.3 (default, Aug  1 2012, 05:14:39) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> assert 1==2
>>>
peerxu
  • 623
  • 1
  • 6
  • 13

2 Answers2

5

PyPy does silently ignore -O. The reasoning behind it is that we believe -O that changes semantics is seriously broken, but well, I guess it's illegal. Feel free to post a bug (that's also where such reports belong, on bugs.pypy.org)

fijal
  • 3,190
  • 18
  • 21
  • 1
    Sorry to hijack. but here is the issue from a couple years ago that i just looked up. https://bugs.pypy.org/issue532 are you saying this will not be implemented? If so, consider update that ticket if there's spare time? – CppLearner Dec 27 '12 at 08:39
  • no, it does not mean it won't be implemented, it means noone implemented it. Otherwise the ticket will be closed as "wontfix". If you feel like implementing it, I'm sure we'll accept the patch (despite thinking it's a dumb idea) – fijal Dec 27 '12 at 16:07
  • thanks for the response. I was just saying maybe consider link the response there. But in any case, that's not so important for most users so even if I have the time I would consider making patch for other issues. Thanks! – CppLearner Dec 27 '12 at 21:23
0

For anyone coming here in the future, Oct 3 2021 pypy3 does accept the -O flag and turn off assertion statements

Justin Furuness
  • 685
  • 8
  • 21