vendredi 6 février 2015

Overloaded parent class fields Python


Vote count:

0




there are some code, but I cant understand why it is working in this way:



class A(object):
first = 20
second = 30


class B(A):
first = 21
second = 31

def mix(A):
print(A.second)

var = B()

var.mix()


and the output is: 31



asked 1 min ago







Overloaded parent class fields Python

Aucun commentaire:

Enregistrer un commentaire