On Feb 16, 11:59 pm, Zack <[EMAIL PROTECTED]> wrote:
> Zack wrote:
> > Diez B. Roggisch wrote:
> >> Zack schrieb:
> >>> If I have a class static variable it doesn't show up in the __dict__
> >>> of an instance of that class.
>
> >>> class C:
> >>> n = 4
>
> >>> x = C()
> >>> print C.__dict__
> >
On Feb 16, 5:03 pm, Zack <[EMAIL PROTECTED]> wrote:
> Dustan wrote:
> > On Feb 16, 4:40 pm, Zack <[EMAIL PROTECTED]> wrote:
> >> what method can you use on x to find all available
> >> attributes for that class?
>
> class Foo(object):
> > bar = "hello, world!"
> > def __init__(self, baz)
Dustan wrote:
> On Feb 16, 5:59 pm, Zack <[EMAIL PROTECTED]> wrote:
>> Zack wrote:
>>> Diez B. Roggisch wrote:
Zack schrieb:
> If I have a class static variable it doesn't show up in the __dict__
> of an instance of that class.
> class C:
>n = 4
> x = C()
> print C.
On Feb 16, 5:59 pm, Zack <[EMAIL PROTECTED]> wrote:
> Zack wrote:
> > Diez B. Roggisch wrote:
> >> Zack schrieb:
> >>> If I have a class static variable it doesn't show up in the __dict__
> >>> of an instance of that class.
>
> >>> class C:
> >>>n = 4
>
> >>> x = C()
> >>> print C.__dict__
> >>
Dustan wrote:
> On Feb 16, 4:40 pm, Zack <[EMAIL PROTECTED]> wrote:
>> what method can you use on x to find all available
>> attributes for that class?
>
class Foo(object):
> bar = "hello, world!"
> def __init__(self, baz):
> self.baz = baz
>
x = Foo(42)
>
>>>
Zack wrote:
> Diez B. Roggisch wrote:
>> Zack schrieb:
>>> If I have a class static variable it doesn't show up in the __dict__
>>> of an instance of that class.
>>>
>>> class C:
>>>n = 4
>>>
>>> x = C()
>>> print C.__dict__
>>> {'__module__': '__main__', '__doc__': None, 'n': 4}
>>> print x._
On Feb 16, 4:40 pm, Zack <[EMAIL PROTECTED]> wrote:
> what method can you use on x to find all available
> attributes for that class?
>>> class Foo(object):
bar = "hello, world!"
def __init__(self, baz):
self.baz = baz
>>> x = Foo(42)
>>> x.__dict__.keys() # Does
Diez B. Roggisch wrote:
> Zack schrieb:
>> If I have a class static variable it doesn't show up in the __dict__
>> of an instance of that class.
>>
>> class C:
>>n = 4
>>
>> x = C()
>> print C.__dict__
>> {'__module__': '__main__', '__doc__': None, 'n': 4}
>> print x.__dict__
>> {}
>>
>> This
Zack schrieb:
> If I have a class static variable it doesn't show up in the __dict__ of
> an instance of that class.
>
> class C:
>n = 4
>
> x = C()
> print C.__dict__
> {'__module__': '__main__', '__doc__': None, 'n': 4}
> print x.__dict__
> {}
>
> This behavior makes sense to me as n is n
If I have a class static variable it doesn't show up in the __dict__ of
an instance of that class.
class C:
n = 4
x = C()
print C.__dict__
{'__module__': '__main__', '__doc__': None, 'n': 4}
print x.__dict__
{}
This behavior makes sense to me as n is not encapsulated in x's
namespace but w
10 matches
Mail list logo