[issue35341] Add generic version of OrderedDict to typing module

2018-12-02 Thread Ismo Toijala
Change by Ismo Toijala : -- keywords: +patch pull_requests: +10085 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35341> ___ ___ Py

[issue35341] Add generic version of OrderedDict to typing module

2018-12-02 Thread Ismo Toijala
Ismo Toijala added the comment: My reason for using OrderedDict was that the normal dict is not reversible. I needed to get the last element added, so I ended up doing something like next(reversed(ordered_dict)). Perhaps this would be something to add to the normal dict (for 3.8?). Then I

[issue35341] Add generic version of OrderedDict to typing module

2018-11-28 Thread Ismo Toijala
New submission from Ismo Toijala : The other collections from the collections module (namedtuple, deque, ChainMap, Counter, defaultdict) have generic versions in the typing module for use in type annotations. The problem is currently the following: from __future__ import annotations import

[issue34921] NoReturn not allowed by get_type_hints when future import annotations is used

2018-11-28 Thread Ismo Toijala
Change by Ismo Toijala : -- pull_requests: +10016 ___ Python tracker <https://bugs.python.org/issue34921> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34921] NoReturn not allowed by get_type_hints when future import annotations is used

2018-10-07 Thread Ismo Toijala
New submission from Ismo Toijala : The following example should work but does not. Note that it does work without the future import. from __future__ import annotations import typing def f() -> typing.NoReturn: pass typing.get_type_hints(f) Traceback (most recent call last): F