Python equivalent for typedef
Python equivalent for typedef Question: What is the python way to define a (non-class) type like: typedef Dict[Union[int, str], Set[str]] RecordType Asked By: OrenIshShalom || Source Answers: This would simply do it? from typing import Dict, Union, Set RecordType = Dict[Union[int, str], Set[str]] def my_func(rec: RecordType): pass my_func({1: {‘2’}}) my_func({1: {2}}) This code will generate …