[issue47068] Improve __repr__ of TypeVar

2022-03-19 Thread Kaleb Barrett
New submission from Kaleb Barrett : Currently the __repr__ for TypeVar includes the variance information and the type name (for example ~T, +T_co, -T_contra), but it does not contain bound or constraint information. I'm not sure what value including variance but not bound information

[issue44529] Using typing.Union in isinstance checks

2021-06-28 Thread Kaleb Barrett
Kaleb Barrett added the comment: Ah, this was implemented for 3.10 as a part of PEP 604. https://www.python.org/dev/peps/pep-0604/#isinstance-and-issubclass. Feel free to close. -- ___ Python tracker <https://bugs.python.org/issue44

[issue44373] make Event an Awaitable

2021-06-28 Thread Kaleb Barrett
Change by Kaleb Barrett : -- title: make Event and Awaitable -> make Event an Awaitable ___ Python tracker <https://bugs.python.org/issue44373> ___ ___ Python-

[issue44529] Using typing.Union in isinstance checks

2021-06-28 Thread Kaleb Barrett
New submission from Kaleb Barrett : I have type aliases of Unions like so: Request = Union[WriteRequest, ReadRequest] I'd like to be able to use "Request" in an isinstance check rather than having to duplicate the information in a tuple to pass to the check. Currently I get:

[issue44373] make Event and Awaitable

2021-06-10 Thread Kaleb Barrett
New submission from Kaleb Barrett : Following on from https://bugs.python.org/issue33544. I don't agree with the original suggestion to deprecate the wait() method on Events, but I do agree that Event should be made Awaitable. Doing so would make code more expressive, but more importantly

[issue43836] range.index doesn't support start/stop optional arguments

2021-04-14 Thread Kaleb Barrett
Kaleb Barrett added the comment: And so it is... There is also a PR open with a solution from 2017. https://github.com/python/cpython/pull/4378/files. Can this get reviewed? The rationalizations against solving this bug stated in the original issue are weak, range.index *is* useful. I use

[issue43836] range.index doesn't support start/stop optional arguments

2021-04-13 Thread Kaleb Barrett
New submission from Kaleb Barrett : The range builtin type is a collections.abc.Sequence, which in Python 3.5 added the optional start and stop arguments to the index method of Sequences. However, range.index does not support these optional arguments required by Sequence. I noticed

[issue42711] lru_cache and NotImplemented

2020-12-21 Thread Kaleb Barrett
New submission from Kaleb Barrett : Having to return `NotImplemented` (which counts as a successful function call) in `functools.lru_cache` and `functools.cache` decorated binary dunder methods has the potential to fill the LRU cache with calls that will in ultimately result in errors (read