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

Compiler directive: warning_undeclared #932

Closed
robertwb opened this issue Sep 16, 2009 · 4 comments
Closed

Compiler directive: warning_undeclared #932

robertwb opened this issue Sep 16, 2009 · 4 comments

Comments

@robertwb
Copy link
Contributor

A directive to warn/give error on any
undeclared variables? I.e.:

@cython.warning_undeclared(True)
def foo():
    global g
    cdef object a
    cdef int b
    g = 3 # ok
    a = 3 # ok
    b = 3 # ok
    c = 3 # warns that "c" is not declared

error_undeclared should probably be available as well.

Implementation note:

In this specific case I think I'd tend to add a few lines in 
analyse_target_type (or whatever) in NameNode I think, without using a transform (where the directives in effect are available in 
env.directives or similar

Migrated from http://trac.cython.org/ticket/369

@robertwb
Copy link
Contributor Author

@robertwb commented

Ideally, this should be rolled into a directive like

@cython.warn(undeclared=True)

@robertwb
Copy link
Contributor Author

robertwb commented Nov 2, 2009

@dagss changed milestone from 0.12 to 0.12.1
commented

@robertwb
Copy link
Contributor Author

robertwb commented Jan 22, 2010

@robertwb changed owner from somebody to robertwb
commented

Depends on http://trac.cython.org/ticket/479.

@robertwb
Copy link
Contributor Author

@robertwb changed resolution to fixed
status from new to closed
commented

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

No branches or pull requests

1 participant