No duplicate variable

King animator333 at gmail.com
Fri Nov 20 11:38:54 EST 2009


class A(object):
    def __init__(self, value=0.):
        self.value = value

class B(A):
    def __init__(self, value=None):
        A.__init__(self)
        self.value = value

obj = B()

When "B" initializes, it overwrite "value" variable of "A". How do I
make sure that no variable should not be defined with names of "A" in
"B"?

Prashant



More information about the Python-list mailing list