Created
April 22, 2020 10:02
-
-
Save ZhouYang1993/51f5f153a50035c532a716a491485eb3 to your computer and use it in GitHub Desktop.
Differences between Class Attribute and Instance Attribute of Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass(object): | |
class_attr = 1 | |
def __init__(self, value): | |
self.instance_attr = value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment