micropython: add micropython component
This commit is contained in:
17
components/language/micropython/tests/basics/class_store.py
Normal file
17
components/language/micropython/tests/basics/class_store.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# store to class vs instance
|
||||
|
||||
class C:
|
||||
pass
|
||||
|
||||
c = C()
|
||||
c.x = 1
|
||||
print(c.x)
|
||||
C.x = 2
|
||||
C.y = 3
|
||||
print(c.x, c.y)
|
||||
print(C.x, C.y)
|
||||
print(C().x, C().y)
|
||||
c = C()
|
||||
print(c.x)
|
||||
c.x = 4
|
||||
print(c.x)
|
Reference in New Issue
Block a user