Skip to content

inspect._get_parser() requires the now-deprecated typing.* collection types #143

@msto

Description

@msto

https://peps.python.org/pep-0585/

Importing those from typing is deprecated. Due to PEP 563 and the intention to minimize the runtime impact of typing, this deprecation will not generate DeprecationWarnings. Instead, type checkers may warn about such deprecated usage when the target version of the checked program is signalled to be Python 3.9 or newer. It’s recommended to allow for those warnings to be silenced on a project-wide basis.

The deprecated functionality may eventually be removed from the typing module. Removal will occur no sooner than Python 3.9’s end of life, scheduled for October 2025.

fgpyo/fgpyo/util/inspect.py

Lines 346 to 353 in cd554be

elif type_ == list:
raise ValueError("Unable to parse list (try typing.List[type])")
elif type_ == tuple:
raise ValueError("Unable to parse tuple (try typing.Tuple[type])")
elif type_ == set:
raise ValueError("Unable to parse set (try typing.Set[type])")
elif type_ == dict:
raise ValueError("Unable to parse dict (try typing.Mapping[type])")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions