Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad practice with assert in codebase #483

Closed
slav0nic opened this issue Sep 5, 2015 · 3 comments
Closed

Bad practice with assert in codebase #483

slav0nic opened this issue Sep 5, 2015 · 3 comments

Comments

@slav0nic
Copy link

slav0nic commented Sep 5, 2015

assert is fine for tests, but you can got some troubles in main codebase like this:

slav0nic@pc:/tmp$ cat ooops.py 
assert(1<0)
slav0nic@pc:/tmp$ python ooops.py 
Traceback (most recent call last):
  File "ooops.py", line 1, in <module>
    assert(1<0)
AssertionError
slav0nic@pc:/tmp$ python -O ooops.py 
slav0nic@pc:/tmp$ python -OO ooops.py 
slav0nic@pc:/tmp$ 

afaik in Debian py modules compiled to pyc after installation, and your will got some troubles with asserts

https://github.com/tavendo/AutobahnPython/search?utf8=%E2%9C%93&q=assert+NOT+test
https://github.com/crossbario/crossbar/search?utf8=%E2%9C%93&q=assert+NOT+test&type=Code

@oberstet
Copy link
Contributor

oberstet commented Sep 6, 2015

duplicate of #99

@oberstet oberstet closed this as completed Sep 6, 2015
@oberstet
Copy link
Contributor

oberstet commented Sep 6, 2015

@slav0nic slightly unrelated rambling: I don't care much about distro Python packaging - it's simple: don't use it. There is no value in distro packaged Python packages.

@oberstet
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants