-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathteste.py
More file actions
39 lines (31 loc) · 726 Bytes
/
teste.py
File metadata and controls
39 lines (31 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#
# import yaml
# # from yaml import load, dump
#
#
# file = open('read_file.card', 'r')
# stream = file.read()
#
# bob = yaml.load_all(stream)
#
#
# for i in bob:
# print(i)
import pdb
class my_decorator(object):
def __init__(self, f):
print("inside my_decorator.__init__()")
self.fun = f
self.teste = 10
#return f(num) # Prove that function definition has completed
def __call__(self,num):
print("inside my_decorator.__call__()")
return self.fun(num)
def __getitem__(self, item):
print("inside my_decorator.__call__()")
return item
@my_decorator
def aFunction(x):
return x*x
pdb.set_trace()
print("Finished decorating aFunction()")