Issue 25830: _TypeAlias: Discrepancy between docstring and behavior (original) (raw)
Issue25830
This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
This issue has been migrated to GitHub: https://github.com/python/cpython/issues/70017
classification
Title: | _TypeAlias: Discrepancy between docstring and behavior | ||
---|---|---|---|
Type: | behavior | Stage: | |
Components: | Library (Lib) | Versions: | Python 3.6, Python 3.5 |
process
Status: | closed | Resolution: | fixed |
---|---|---|---|
Dependencies: | Superseder: | ||
Assigned To: | Nosy List: | berker.peksag, flying sheep, gvanrossum, levkivskyi | |
Priority: | normal | Keywords: |
Created on 2015-12-09 11:57 by flying sheep, last changed 2022-04-11 14:58 by admin. This issue is now closed.
Messages (4) | ||
---|---|---|
msg256154 - (view) | Author: (flying sheep) * | Date: 2015-12-09 11:57 |
_TypeAlias claims in its docstring that “It can be used in instance and subclass checks”, yet promptly contradicts itself if you try it: “Type aliases cannot be used with isinstance().” it would be useful to either document (and therefore bless) type_impl, or make it actually work with isinstance (probably by delegating to type_impl) | ||
msg258776 - (view) | Author: Berker Peksag (berker.peksag) * ![]() |
Date: 2016-01-21 22:36 |
Looks like the docstring is a bit misleading. ``isinstance(m, Match)`` behavior is already tested in the test suite: https://hg.python.org/cpython/file/default/Lib/test/test_typing.py#l1297 | ||
msg258778 - (view) | Author: Guido van Rossum (gvanrossum) * ![]() |
Date: 2016-01-21 23:25 |
Actually isinstance() shouldn't be supported by most things in typing.py (except for those that mimic existing collection ABCs). Even issubclass() should be taken out according to the BDFL-delegate for PEP 484. See https://github.com/ambv/typehinting/issues/136 | ||
msg277560 - (view) | Author: Guido van Rossum (gvanrossum) * ![]() |
Date: 2016-09-27 22:26 |
Fixed by 09cc43df4509. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:58:24 | admin | set | github: 70017 |
2016-09-27 22:26:00 | gvanrossum | set | status: open -> closedresolution: fixedmessages: + |
2016-06-30 22:05:41 | levkivskyi | set | nosy: + levkivskyi |
2016-05-16 16:43:08 | berker.peksag | link | issue25650 superseder |
2016-01-21 23:25:22 | gvanrossum | set | messages: + |
2016-01-21 22:36:31 | berker.peksag | set | nosy: + berker.peksag, gvanrossummessages: + |
2015-12-09 11:57:32 | flying sheep | create |