I have a situation where in first class I declare array, and I pass it to another object, which prints name of elements in this array. It works, but when I input 'car.' in ReadCarNames ide doesn't suggest me 'name' ? I'm trying it in wing ide 4 pro. Can I cast car in method ReadCarNames ?
########################################################################
class MyClass:
""""""
#----------------------------------------------------------------------
def __init__(self):
cars=[]
cars.append(Car('bmw'))
cars.append(Car('audi'))
reader=Reader()
reader.ReadCarNames(cars)
########################################################################
class Car:
""""""
#----------------------------------------------------------------------
def __init__(self,name):
self.name=name
########################################################################
class Reader:
""""""
#----------------------------------------------------------------------
def __init__(self):
"""Constructor"""
def ReadCarNames(self,cars):
for counter,car in enumerate(cars):
print str(counter) +' '+ car.name