Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- STATE_VAR = 0
- def do_something(arg1):
- global STATE_VAR
- if arg1:
- STATE_VAR = 1
- def say_hello():
- if STATE_VAR:
- print("Hello!")
- class MyClass:
- STATE_VAR = 0
- @classmethod
- def do_something(cls, arg1):
- if arg1:
- cls.STATE_VAR = 1
- @classmethod
- def say_hello(cls):
- if cls.STATE_VAR:
- print("Hello!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement