Global variable is undefined at the module level
Peter Otten
__peter__ at web.de
Tue Sep 13 07:39:43 EDT 2016
More information about the Python-list mailing list
Tue Sep 13 07:39:43 EDT 2016
- Previous message (by thread): Global variable is undefined at the module level
- Next message (by thread): Global variable is undefined at the module level
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Daiyue Weng wrote: > Hi, I defined a global variable in some function like this, > > def some_function(self): > > global global_var > > PyCharm inspection gave me, > > Global variable is undefined at the module level There is no single way to silence that complaint and actually improve your code; you have to provide some context: Why do you need a global at all, why can't you (or don't want to) bind it on the module level etc.
- Previous message (by thread): Global variable is undefined at the module level
- Next message (by thread): Global variable is undefined at the module level
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list