On Aug 15, 2014, at 5:26 PM, Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
Łukasz Langa wrote:
class C: cls_member: str = ‘on the class’ def __init__(self): self.obj_member: str = ‘on the instance' self.cls_member = 2 # that’s the real question: type error or an instance member?
I think not treating it as an error would make it hard to reason about the type of x.cls_member for an instance x of C. Its type would depend on whether del x.cls_member had been performed on x.
Code which relied on them being different types would be rather confusing to a human reader too, so it's probably fine to discourage that.
That was my reasoning exactly. +1 -- Best regards, Łukasz Langa WWW: http://lukasz.langa.pl/ Twitter: @llanga IRC: ambv on #python-dev