Steven Bethard wrote:
> But why do you want a class level attribute with the same name as an 
> instance level attribute?  I would have written your class as:
>
> class A(object):
>      __slots__ = ['value']
>      def __init__(self, value=1):
>          self.value = value
>
> where the default value you put in the class is simply expressed as a 
> default value to the __init__ parameter.

Thanks for your explanation. The reason why I was doing it was
to have class-level defaults, so that one can easily adjust how
new instances will be made. I'm doing it now with capitilized
class attribute names to avoid the name clash.

--
  --  Ewald
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to