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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃敟 Remove _typing.py file #805

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ivantodorovich
Copy link

It was only used to import the get_args and get_origin methods, but we can import them from typing_extensions directly.

Copy link

馃摑 Docs preview for commit 0f77a8a at: https://2f3710b1.typertiangolo.pages.dev

It was only used to import the `get_args` and `get_origin` methods, but we can
import them from `typing_extensions` directly.
Copy link

馃摑 Docs preview for commit f5f5304 at: https://bf7d0262.typertiangolo.pages.dev

Copy link
Collaborator

@svlandeg svlandeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the contribution! It would be great to clean this up.

As you're deleting quite a bit of code though, can you elaborate a bit more on why it's all become obsolete?

"get_sub_types",
"typing_base",
"get_all_type_hints",
"is_union",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the unmerged PR #548 uses is_union (as well as get_args and get_origin) so either way I'd recommend merging that PR before we handle this one.

@ivantodorovich
Copy link
Author

Hi, thanks for the contribution! It would be great to clean this up.
As you're deleting quite a bit of code though, can you elaborate a bit more on why it's all become obsolete?

This file was extracted from pydantic, before pydantic removed it with its support of python3.6
The header said:
Copied from pydantic 1.9.2 (the latest version to support python 3.6.)

As mentioned above, the only 2 methods used in this big file were get_args and get_origin, which can easily be imported from the maintained typing_extensions package.

My guess is that this file was useful for python3.6, but now it's not, as libraries like typing_extensions or even the standard library have grown and include other alternatives

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants