Just wondering if there is a problem with mixing a dictionary into a class
like this. Everything seems to work as I would expect.
class foo(object):
def __init__(self, x):
self.letter = dict(a=1,b=2,c=3)
self.A=self.letter['a']
self.x=self.letter[x]
>>> afoo = foo('b')
>>> afoo.x
2
>>> afoo.A
1
>>> afoo.letter['a']
1
>>> afoo.letter.items()
[('a', 1), ('c', 3), ('b', 2)]
*Vincent Davis
720-301-3003 *
[email protected]
my blog <http://vincentdavis.net> |
LinkedIn<http://www.linkedin.com/in/vincentdavis>
--
http://mail.python.org/mailman/listinfo/python-list