From Dict to Classes yes or no and how

James Mills prologic at shortcircuit.net.au
Tue Jun 22 08:22:02 EDT 2010


On Tue, Jun 22, 2010 at 9:56 PM, Jerry Rocteur <macosx at rocteur.cc> wrote:
> 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 and I don't know how or if it is possible.

I suggest you start playing around with python classes and objects.

It's entirely possible you can create your own class that
represents your data and store this in some fashion.

You could also subclass (you'll learn about this) the dict class
creating your own customized dict (if you will).

The former approach may be better suited however instead of
diving into things you may not yet come to fully understand
until you really learn the inner workings of python :)

cheers
James

-- 
--
-- "Problems are solved by method"



More information about the Python-list mailing list