Closed
Description
from typing import NewType
Ticker = NewType('Ticker', str)
SecurityID = NewType('SecurityID', str)
SYMBOLS = {
'ham': '4a24ab25-766d-4d6c-99e2-337da6d0ba45',
'spam': 'e8248888-b413-4def-b11a-763b10faf9c0',
} # type: Dict[Ticker, SecurityID]
INDICES = {
'eggs',
'mayo',
} # type: Set[Ticker]
TICKERS = INDICES | SYMBOLS.keys() # type: Set[Ticker]
Results in:
s.py:7: error: List item 0 has incompatible type "Tuple[str, str]"
s.py:7: error: List item 1 has incompatible type "Tuple[str, str]"
s.py:12: error: Argument 1 to <set> has incompatible type "str"; expected "Ticker"
s.py:12: error: Argument 2 to <set> has incompatible type "str"; expected "Ticker"