I want to call an object of another class in my class but when i run the code it says: RecursionError: maximum recursion depth exceeded
Any ideas of what error im making?
This is my code:
class Anden(Estacion):
def __init__ (self,ID):
self.ID=ID
self.filas_anden=[0,0,0,0,0,0,0,0,0,0]
self.puertas = []
while len(self.puertas) < 10:
puerta = Puerta(len(self.puertas))
def asignar_fila(self, pasajero):
aux=10000000000
puerta_asignada = min(filas_anden)
for i in range(10):
if aux > self.puertas[i].total_fila:
aux = self.puertas[i].total_fila
fila_asignada = i
pasajero.fila_actual = i
self.filas_anden[i] +=1
self.puertas[i].append(pasajero)
class Puerta(Anden):
def _init_ (self,ID):
self.ID = ID
self.lista_pasajeros = []
self.total_fila = 0
def ingresa_pasajero_fila(self, pasajero):
self.lista_pasajeros.append(pasajero)
self.total_fila = self.total_fila + 1
def remover_pasajero_fila(self, pasajero):
self.lista_pasajeros.remove(pasajero)
self.total_fila = self.total_fila - 1