question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

typing_extensions shouldn't be a dependency on Python 3.11+

See original GitHub issue

Describe the bug All of the names imported from typing_extensions are available in the typing module in the standard library on Python 3.11+.

To Reproduce

  1. for example python3 -c "from typing import Never" where python3 is Python 3.11

Please complete the following information:

  • OS: Linux
  • OS Version Void Linux rolling
  • python 3.11
  • version of type checker -
  • version of installed pandas-stubs master

Additional context Most programs do something similar to this:

try:
	from typing import Never
except ImportError:
	from typing_extensions import Never

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
paper42commented, Dec 21, 2022

It is just an unnecessary dependency I noticed, nothing more. I was not aware of the issue with try except block and I get that comparing the python version would be unnecessarily complicated. Thank you and feel free to close this issue.

1reaction
twoertweincommented, Dec 20, 2022

Thank you for differentiating typing vs. collections.abc and typing vs. typing_extensions! I just now realized you meant to prioretize typing_extension.Literal over typing.Literal - I was thinking about the opposite. Similar to numpy, pandas(-stubs) requires 3.8+.

I think we should simply wait until pandas requires a newer python version before avoiding the typing_extension imports.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Missed dependency when import web3: typing_extensions
However, say a user is running python 3.6/3.7, then they need to have typing_extensions installed if they want to do any type checking....
Read more >
typing-extensions
The following have always been present in typing , but the typing_extensions versions provide additional features: Any (supports inheritance since Python 3.11) ...
Read more >
pytest coverage not working after python update to 3.11
In Python 3.6, upgrade all dependencies to the latest version that supports Python ... tomli==2.0.1 typing_extensions==4.4.0 zipp==3.11.0.
Read more >
python/typing - Gitter
I am wondering what is the best practice with typing_extensions installation? Should it be a runtime dependency or a dev-depedency?
Read more >
Python 3.11 Preview: TOML and tomllib
To resolve the situation, PEP 518 introduced the pyproject.toml configuration file, which specifies Python project build dependencies. PEP 518 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found