Closed arnaud-ma closed 2 months ago
What's the story here?
I apologize for the waste of time. I realized there were too many conflicts with other pull requests. It seems easier to me to make a (much) cleaner one later. The goals remain: update the < 3.8 Python code and add more precise type hints.
I see. Sorry for the conflicts! I think making a few smaller PRs will make it easier to merge! Thanks!
Some code must have been added before Python 3.8. We can put this version to good use. These fixes do not modify the runtime in any way.
Changes:
typing.Protocol
andtyping.TypedDict
instead of bare dict, callable or typesI think it is possible to go much further in type annotation (e.g. by annotating some methods with *args and **kwargs). But for this, typing-extensions must be added as a dependency.
I thought for a long time that using
from __future__ import annotations
to usedict[str | int, int] | List[str |int]
instead ofUnion[Dict[Union[str, int], int], List[Union[str, int]]
would be a good idea, but the package itself does not support this syntax so it would only be an additional source of bugs.