However, I ran into issues:
(1) mypy doesn't support using variables as TypedDict keys: https://github.com/python/mypy/issues/7178. This unfortunate deficiency means TypedDict is not suitable here until mypy improves.
(2) Using type as a key is messy, since it's a "soft keyword". Maybe it would be better to use kind? This should have a benefit beyond mypy.
Solves another 3
mypy
errors.config_types
below seemed like a good candidate for using aTypedDict
(~equivalent to astruct
) https://github.com/pymodbus-dev/pymodbus/blob/214c7ed4ef27c686ad5d161b78477cc5aa6cb1cc/pymodbus/datastore/simulator.py#L110-L117However, I ran into issues: (1)
mypy
doesn't support using variables asTypedDict
keys: https://github.com/python/mypy/issues/7178. This unfortunate deficiency meansTypedDict
is not suitable here untilmypy
improves. (2) Usingtype
as a key is messy, since it's a "soft keyword". Maybe it would be better to usekind
? This should have a benefit beyondmypy
.