-
Notifications
You must be signed in to change notification settings - Fork 0
/
.test.py
71 lines (42 loc) · 997 Bytes
/
.test.py
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
"""
Testing Grounds
"""
class Subclass:
def __init__(self,name):
self.name = name
class Myclass(object):
def __init__(self,contents):
self.contents = contents
self.temp = 'mine'
####################
# ... require cell to contain plasmid
reqs = {
'temp':'mie',
'contents':[{'name':'A'},{'name':'B'}]
}
mc = Myclass([Subclass('A'),Subclass('B')])
print _check_attributes(mc,reqs)
'''#
class Test(object):
def __init__(self):
self.mw = 5.0
self._mass = 0.
self._mols = 0.
self.mols = 5
@property
def mass(self):
return self._mass
@property
def mols(self):
return self._mols
@mass.setter
def mass(self,value):
self._mass = value
self._mols = value/self.mw
test = Test()
print test.mass,test.mols
setattr(test,'mass',5)
print test.mass,test.mols
#test.mols = 10
print test.mass,test.mols
#'''#