1
0
mirror of https://github.com/gryf/pythonhelper.git synced 2025-12-19 12:28:16 +01:00
Files
pythonhelper/plugin/test_py_example.py

43 lines
760 B
Python

import os
class Foo(object):
"""Some doc"""
CLASS_ATTR = {"dict": 1,
"bla": "foobar"}
def __init__(self, arg):
"""initializaion"""
self.arg = arg
def method(self, x, y):
"""very important method"""
def inner_funtion(x, y):
for i in y:
x = x + i
result = y[:]
result.append(x)
return result
result = None
result2 = """\
multiline
string
the
annoying
bastard"""
if self.arg < 100:
result = inner_funtion(x, y)
return result if result else result2
def main():
instance = Foo(10)
print(os.path.curdir, instance.method(2, [1, 2, 3]))
if __name__ == "__main__":
main()