From Dict to Classes yes or no and how
Bruno Desthuilliers
bruno.42.desthuilliers at websiteburo.invalid
Tue Jun 22 08:29:24 EDT 2010
Jerry Rocteur a écrit :
(snip)
> As part of learning Python, I'm also learning OOP! That is why I want to know if this is doable using classes.
>
> The input is not important, I end up with the dictionary as described in the question and as I asked in the question,
> I'd like to access the dictionary as a class
I assume you mean "as an object" (or "as an instance of a class" - which
is exactly the same thing). If you don't understand what this means,
then you should first learn the difference between a class and an
instance !-)
> and I don't know how or if it is possible.
Well, Python being 100% object, your dict is already an object (an
instance of the builtin 'dict' class).
More information about the Python-list
mailing list