Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
msto opened this issue Jun 12, 2024 · 1 comment
Open
Labels
good first issue Good for newcomers

Comments

@msto
Copy link
Contributor

msto commented Jun 12, 2024

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])")

@nh13 nh13 added the good first issue Good for newcomers label Jul 13, 2024
@TimD1
Copy link
Contributor

TimD1 commented Sep 3, 2024

Is the plan for this issue to remove typing.List (and other types) from inspect._get_parser only, or to also more generally replace all usage of typing.List with list?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants