-
-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Description
I can define a variable named g but I can't actually use it. Simple example:
g = 42
x = g + 10result:
py5 encountered an error in your code:
1 g = 42
--> 2 x = g + 10
3
..................................................
g = 42
..................................................
TypeError: 'int' object is not callableI don't know why I didn't find this problem before. I guess when I tested it I only tested I could create a variable named g but didn't use it for anything.
I agree with @villares 's logic of allowing g as a variable name because single character reserved words are problematic. However, this configuration isn't going to work.
The solution is to rename g to something else, such as graphics. The new name will become a reserved word. @villares, are you ok with renaming g to graphics and making it a reserved word? Any other name suggestions?
villares
Metadata
Metadata
Assignees
Labels
No labels