In article <[email protected]>,
Andreas Balogh  <[email protected]> wrote:
>
>My question to the Python specialists: which one is the most correct?
>Are there restrictions with regards to pickling or copy()?
>Which one should I choose?

What's your goal?  I'd probably do the dirt simple myself:

class AttrDict(dict):
    def __getattr__(self, attr):
        if attr in self:
            return self[attr]
        else:
            raise AttributeError

    def __setattr__(self, attr, value):
        self[attr] = value

d = AttrDict()
d.foo = 'bar'
print d.foo
-- 
Aahz ([email protected])           <*>         http://www.pythoncraft.com/

"To me vi is Zen.  To use vi is to practice zen.  Every command is a
koan.  Profound to the user, unintelligible to the uninitiated.  You
discover truth everytime you use it."  [email protected]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to