On Tuesday 18 August 2009 21:44:55 Pavel Panchekha wrote:
> I want a dictionary that will transparently "inherit" from a parent
> dictionary. So, for example:
>
> """
> a = InheritDict({1: "one", 2: "two", 4: "four"})
> b = InheritDict({3: "three", 4: "foobar"}, inherit_from=a)
>
> a[1] # "one"
> a
On Tue, Aug 18, 2009 at 6:08 PM, Simon Forman wrote:
> On Aug 18, 3:44 pm, Pavel Panchekha wrote:
>> I want a dictionary that will transparently "inherit" from a parent
>> dictionary. So, for example:
>>
>> """
>> a = InheritDict({1: "one", 2: "two", 4: "four"})
>> b = InheritDict({3: "three", 4:
On Aug 18, 3:44 pm, Pavel Panchekha wrote:
> I want a dictionary that will transparently "inherit" from a parent
> dictionary. So, for example:
>
> """
> a = InheritDict({1: "one", 2: "two", 4: "four"})
> b = InheritDict({3: "three", 4: "foobar"}, inherit_from=a)
>
> a[1] # "one"
> a[4] # "four"
>
On Aug 18, 5:11 pm, "Jan Kaliszewski" wrote:
> 18-08-2009 o 22:27:41 Nat Williams wrote:
>
>
>
> > On Tue, Aug 18, 2009 at 2:44 PM, Pavel Panchekha
> > wrote:
>
> >> I want a dictionary that will transparently "inherit" from a parent
> >> dictionary. So, for example:
>
> >> """
> >> a = Inherit
18-08-2009 o 22:27:41 Nat Williams wrote:
On Tue, Aug 18, 2009 at 2:44 PM, Pavel Panchekha
wrote:
I want a dictionary that will transparently "inherit" from a parent
dictionary. So, for example:
"""
a = InheritDict({1: "one", 2: "two", 4: "four"})
b = InheritDict({3: "three", 4: "foobar"},
On Aug 18, 4:23 pm, "Jan Kaliszewski" wrote:
> 18-08-2009 o 21:44:55 Pavel Panchekha wrote:
>
>
>
> > I want a dictionary that will transparently "inherit" from a parent
> > dictionary. So, for example:
>
> > """
> > a = InheritDict({1: "one", 2: "two", 4: "four"})
> > b = InheritDict({3: "three"
On Tue, Aug 18, 2009 at 2:44 PM, Pavel Panchekha wrote:
> I want a dictionary that will transparently "inherit" from a parent
> dictionary. So, for example:
>
> """
> a = InheritDict({1: "one", 2: "two", 4: "four"})
> b = InheritDict({3: "three", 4: "foobar"}, inherit_from=a)
>
> a[1] # "one"
> a[
18-08-2009 o 21:44:55 Pavel Panchekha wrote:
I want a dictionary that will transparently "inherit" from a parent
dictionary. So, for example:
"""
a = InheritDict({1: "one", 2: "two", 4: "four"})
b = InheritDict({3: "three", 4: "foobar"}, inherit_from=a)
a[1] # "one"
a[4] # "four"
b[1] # "one"
On Fri, 17 Apr 2009 17:48:55 +0200, Diez B. Roggisch wrote:
> No, because you are creating *classvariables* when declaring things like
> this:
...
> OTOH, when assigning to an instance, this will create an
> *instance*-variable. Which is what
If an integer variable is an integer, and a string va
Dominik Ruf wrote:
> Hi,
>
> I just stumbled upon the following behaviour.
class base():
> ... dic = {'1':'1', '2':'2'}
> ...
class child1(base):
> ... def __init__(self):
> ... self.dic.update({'1':'2'})
> ...
class child2(base):
> ... pass
> ...
c1 = child1()
10 matches
Mail list logo