0

I have a class Household

class Household:
    def __init__(self,A=[]):

        self._A = A
    @property
    def A(self):
        """List of firms connected to by type A"""
        return self._A

    @A.setter
    def A(self, value):
        self._A = value
h = Household()
h.A.append(4)

h = Household()
h.A

I thought this should return empty list []. But instead I get [4]. Why?

MaxYarmolinsky
  • 1,117
  • 1
  • 10
  • 16

0 Answers0