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

Add warnings about "obviously unintended" code #2814

Open
scoder opened this Issue Jan 25, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@scoder
Copy link
Contributor

scoder commented Jan 25, 2019

There is an interesting discussion on the python-dev mailing list about issuing more warnings from the CPython compiler about code that will lead to errors at runtime (if executed). Serhiy Storchaka has written a proof-of-concept patch in the corresponding ticket, that handles several such cases.

Cython already rejects a few more constructs than CPython at compile time, but is otherwise quite relaxed about things that will lead to runtime errors (but that might not get executed and would therefore not necessarily fail the program).

There are many places where a compile time warning could avoid having to write tests and/or require users to run the code in order to detect problems. Cython should issue a warning for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment