Nafai77 (owner)

Revisions

gist: 203360 Download_button fork
public
Public Clone URL: git://gist.github.com/203360.git
Embed All Files: show embed
Python #
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
#!/usr/bin/python
 
class Foo(object):
    cmds = {}
 
 
class Bar(Foo):
    pass
 
 
class Baz(Foo):
    pass
 
 
Bar.cmds.update({"foo": 1, "bar": 2})
 
Baz.cmds.update({"bar": 0, "foo": 10})
 
 
print "Foo.cmds: %s" % str(Foo.cmds)
print "Bar.cmds: %s" % str(Bar.cmds)
print "Baz.cmds: %s" % str(Baz.cmds)
 
"""
output:
Foo.cmds: {'foo': 10, 'bar': 0}
Bar.cmds: {'foo': 10, 'bar': 0}
Baz.cmds: {'foo': 10, 'bar': 0}
"""