diff options
author | Reece Dunham <jumbocakefdx@gmail.com> | 2019-02-05 06:06:08 +0300 |
---|---|---|
committer | Ilya <darpa@yandex.ru> | 2019-02-05 06:06:08 +0300 |
commit | bff73a39759e63842a974db3efe98bab61a9689a (patch) | |
tree | f0d2a41fe8b3a908e99f418a92cca9b3cdc09078 /demos | |
parent | ec12f373ecd59769554ec7ee675233d898495c46 (diff) |
Fix broken python method (#8821)
Diffstat (limited to 'demos')
-rwxr-xr-x | demos/python/class1.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/demos/python/class1.py b/demos/python/class1.py index 23209a9208..ad92344945 100755 --- a/demos/python/class1.py +++ b/demos/python/class1.py @@ -4,7 +4,9 @@ import json # Define a class with a method that returns JSON class returnsjson: - def method1(this): + def __init__(self): + the_object = self + def method1(self): return json.dumps(['foo', { 'bar': ('baz', None, 1.0, 2), @@ -14,5 +16,4 @@ class returnsjson: 1,2,3]) c = returnsjson() -print (c.method1()) - +print(c.method1()) |