The problem for me, in giving a specific suggestion, is that you have said
your dictionary structure is completely variable in both its nested depth
and its composition of types. So this will make it difficult to use in
every function you give it to since any of them will need to scan through
it to find something.
It would be much easier on you to figure out what data you need to store
and what it will look like. As Paul suggested, you may find it more
manageable to keep the data in multiple fields of a custom class, with
methods that help to read and write to the structure.
 On Nov 6, 2013 4:03 AM, "Paul Molodowitch" <[email protected]> wrote:

> I'm not sure if this is the most efficient way to store the data, actually
>> I'm pretty sure it's among the worst, heh :p The reason why I'm storing in
>> a dictionary is that I have some pretty large functions, and I want to be
>> able to go in and get any object created within the function after it has
>> run, so I thought dictionaries was the most readable way to do it, do you
>> have any other suggestions?
>>
>
> Try using object-oriented programming (OOP) - ie, classes.  The problem of
> associating a common set of data with a set of functions is one of the core
> issues that OOP was created to solve.  Unfortunately, this isn't
> necessarily an "easy" solution - learning how to properly use classes is
> something that will take practice - but it's well worth the effort, in my
> opinion.
>
> Also - at a guess, you might also want to try breaking your "pretty large
> functions" into several smaller ones, if possible...
>
> - Paul
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAAssL7bEtFkgWN5W9eccGi6OYNeEMCD0%3D7i5To9Ehdr4d6gC_Q%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA38vPFyd7av%2B4W2CsBOSLqLLVQ4zVu6DHWC6jF550u7_w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to