[issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias`

Serhiy Storchaka report at bugs.python.org
Sun Jan 23 09:52:11 EST 2022


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Why __class_getitem__ was added in PurePath at first place? PurePath should not be a generic class, unlike to os.PathLike. For os.PathLike the type parameters represent the returning type of os.fspath() (either str or bytes), but the pathlib module only supports paths as strings, so no parametrization is needed.

I think PurePath.__class_getitem__ should be removed.

----------
nosy: +gvanrossum, kj, serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46483>
_______________________________________


More information about the Python-bugs-list mailing list