Sorry if the question is a bit confusing but I didn't know how to phrase it better.
This is what I would like to do.
class Land():
upgrades_available = 10
market_type: str = ""
land_list: list[Land] = []
def __init__(self, position: str, price: int):
self.position: str = position
self.price: int = price
self.upgrade_level: int = 0
Land.land_list.append(self)
Unfortunately the interpreter doesn't like the following line:
land_list: list[Land] = [] # Unresolved reference 'Land'
I can understand why that's not possible because I imagine an infinite loop could be the result, but is there a way around this? I would like the interpreter to recognize that this list contains Land objects for ducktyping.