I am trying to use a dictionary containing several objects in a class Company
. The dictionary contains a string year
as its key and an object representing the company's balance sheet as its value.
My problem is, that when using the dictionary, I don't get autocompletion. What is the proper way to deal with this issue? Should you even use objects in dictionaries to represent attributes of another object?
Here my code:
class Company:
balance_sheets = dict() # List holding all balance sheets of the past 4 years
def __init__(self, ticker):
...
self.balance_sheets[year] = BalanceSheet(bs[column], year)
...
comp = Company("AAPL")
balancesheet = comp.balance_sheets.get('2019') # gets me balance sheet of 2019
balancesheet.ppe # This is where I want it to autocomplete the object's attributes
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…