Ticket #369 (closed enhancement: fixed)
Compiler directive: warning_undeclared
| Reported by: | dagss | Owned by: | robertwb |
|---|---|---|---|
| Priority: | major | Milestone: | 0.12.1 |
| Component: | Parsing | Keywords: | |
| Cc: |
Description
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
Change History
Note: See
TracTickets for help on using
tickets.
