Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to disable pypy assert statement?

Tags:

python

pypy

$ ./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
>>>
like image 264
peerxu Avatar asked Dec 27 '12 07:12

peerxu


1 Answers

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)

like image 119
fijal Avatar answered Sep 29 '22 19:09

fijal