diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-01-19 17:41:01 +0000 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-01-19 17:41:01 +0000 |
| commit | 5f7e8dc176661b49e12a0d8425101799ff176d19 (patch) | |
| tree | 0fd3daa844300d62a3836b5bb16c3c7be2b875cb /tests/basics/class2.py | |
| parent | b2ebb161d494864cdbee05ee8b74a775845e238e (diff) | |
| parent | db796ef84d1737edc4ee44f1b53ff0c1fddb349c (diff) | |
Merge branch 'master' of github.com:micropython/micropython
Diffstat (limited to 'tests/basics/class2.py')
| -rw-r--r-- | tests/basics/class2.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/basics/class2.py b/tests/basics/class2.py new file mode 100644 index 000000000..64f1f62b9 --- /dev/null +++ b/tests/basics/class2.py @@ -0,0 +1,17 @@ +# class with __init__ + +class C1: + def __init__(self): + self.x = 1 + +c1 = C1() +print(type(c1) == C1) +print(c1.x) + +class C2: + def __init__(self, x): + self.x = x + +c2 = C2(4) +print(type(c2) == C2) +print(c2.x) |
