baloan wrote:
On Oct 22, 6:34 am, "Gabriel Genellina"
wrote:
class AttrDict(dict):
"""A dict whose items can also be accessed as member variables."""
def __init__(self, *args, **kwargs):
dict.__init__(self, *args, **kwargs)
self.__dict__ = self
def copy(self):
On Oct 22, 6:34 am, "Gabriel Genellina"
wrote:
> > class AttrDict(dict):
> > """A dict whose items can also be accessed as member variables."""
> > def __init__(self, *args, **kwargs):
> > dict.__init__(self, *args, **kwargs)
> > self.__dict__ = self
>
> > def copy
En Wed, 21 Oct 2009 18:40:01 -0300, Andreas Balogh
escribió:
Gabriel, thanks for your hint. I've managed to create an implementation
of an AttrDict passing Gabriels tests.
Any more comments about the pythonicness of this implementation?
class AttrDict(dict):
"""A dict whose items can
Gabriel, thanks for your hint. I've managed to create an implementation of an AttrDict
passing Gabriels tests.
Any more comments about the pythonicness of this implementation?
class AttrDict(dict):
"""A dict whose items can also be accessed as member variables."""
def __init__(self, *ar
In article ,
Terry Reedy wrote:
>Aahz wrote:
>> In article ,
>> Andreas Balogh 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 probabl
Aahz wrote:
In article ,
Andreas Balogh 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
In article ,
Andreas Balogh 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_
En Mon, 12 Oct 2009 16:58:35 -0300, Andreas Balogh
escribió:
googling I found several ways of implementing a "dictionary with
attribute-style access".
1. ActiveState cookbook: http://code.activestate.com/recipes/473786/
2. ActiveState cookbook:
http://aspn.activestate.com/ASPN/Cookbook
On Mon, 12 Oct 2009 20:58:35 +0100, Andreas Balogh
wrote:
Hello,
googling I found several ways of implementing a "dictionary with
attribute-style access".
1. ActiveState cookbook: http://code.activestate.com/recipes/473786/
2. ActiveState cookbook:
http://aspn.activestate.com/ASPN/Coo
Hello,
googling I found several ways of implementing a "dictionary with
attribute-style access".
1. ActiveState cookbook: http://code.activestate.com/recipes/473786/
2. ActiveState cookbook:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/361668
3. web2py codebase: Storage(dict)
I
10 matches
Mail list logo