Aug-28-2020, 01:31 PM
Hi,
I'm fairly new to Python and I'm getting this error and to be honest, I have no clue why. I get it when running a pytest. The full stacktrace is:
The relevant code is the following:
test_central_bank.py
Thanks in advance,
Stef
I'm fairly new to Python and I'm getting this error and to be honest, I have no clue why. I get it when running a pytest. The full stacktrace is:
Quote:emusim/pytest/test_central_bank.py:1: in <module>
from emusim.cockpit.supply.euro import CentralBank
emusim/cockpit/supply/__init__.py:1: in <module>
from .data_collector import DataCollector
emusim/cockpit/supply/data_collector.py:6: in <module>
class DataCollector(ABC):
emusim/cockpit/supply/data_collector.py:13: in DataCollector
def data_structure(self) -> OrderedDict[str, OrderedDict[str, bool]]:
E TypeError: 'type' object is not subscriptable
The relevant code is the following:
test_central_bank.py
from emusim.cockpit.supply.euro import CentralBank__init__.py
from .data_collector import DataCollectordata_collector.py
from abc import ABC, abstractmethod from collections import OrderedDict from typing import List, KeysView class DataCollector(ABC): def __init__(self): self.__data_dict: OrderedDict[str, OrderedDict[str, List[float]]] = OrderedDict() @abstractmethod @property def data_structure(self) -> OrderedDict[str, OrderedDict[str, bool]]: passWhat am I not seeing here?
Thanks in advance,
Stef