jacksonhaenc...@gmail.com writes:
> This is not accurate. I just tested this in python3 and using the global
> keyword allowed me to declare a variable inside the function that was
> then visible from the outer scope.
What do you mean by that?
Anything other than what was said here?
> On Tuesday
This is not accurate. I just tested this in python3 and using the global
keyword allowed me to declare a variable inside the function that was then
visible from the outer scope.
On Tuesday, September 13, 2016 at 6:50:39 AM UTC-5, dieter wrote:
> Daiyue Weng writes:
>
> > Hi, I defined a global
Daiyue Weng writes:
> 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
>
> How to fix this?
You define the global variable at the module level.
On Tuesday, September 13, 2016 at 6:42:56 AM UTC-4, 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
>
> How to fix this?
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 y