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

bpo-38291: Remove mention of typing.io and typing.re again #26113

Merged
merged 3 commits into from Jun 14, 2021

Conversation

@srittau
Copy link
Contributor

@srittau srittau commented May 13, 2021

They were originally removed in GH-10173 per bpo-35089, but then
readded in GH-21574. Cf. bpo-38291 for decision to remove. This PR
only partly addresses this bug, as the modules should be deprecated as
well (as they were never properly supported.)

https://bugs.python.org/issue38291

They were originally removed in pythonGH-10173 per bpo-35089, but then
readded in pythonGH-21574. Cf. bpo-38291 for decision to remove.
@JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented May 13, 2021

Wouldn't it be better to say these namespaces are deprecated? The feature was promised in PEP 484 and previously mentioned in the typing docs, so we can't just hide it completely.

Here's a possible proposal:

  • In the docs for 3.10 and earlier versions, say something like "This feature was never properly supported by most type checkers and will be deprecated in the future"
  • In 3.11 (main), edit typing.py to emit DeprecationWarning in __getattr__ for the io and re pseudo-modules. (I think they're actually implemented as classes.) In the docs, say that they are deprecated.
  • In 3.12 or 3.13, remove them.

@srittau
Copy link
Contributor Author

@srittau srittau commented May 13, 2021

Sounds good. I will modify this text tomorrow to a deprecation notice.

Copy link
Member

@gvanrossum gvanrossum left a comment

Maybe the docs should actually list these as deprecated? (That would presumably be a "deprecated" note for the entire typing module.)

@Fidget-Spinner
Copy link
Contributor

@Fidget-Spinner Fidget-Spinner commented May 13, 2021

Wouldn't it be better to say these namespaces are deprecated? The feature was promised in PEP 484 and previously mentioned in the typing docs, so we can't just hide it completely.

Here's a possible proposal:

  • In the docs for 3.10 and earlier versions, say something like "This feature was never properly supported by most type checkers and will be deprecated in the future"
  • In 3.11 (main), edit typing.py to emit DeprecationWarning in __getattr__ for the io and re pseudo-modules. (I think they're actually implemented as classes.) In the docs, say that they are deprecated.
  • In 3.12 or 3.13, remove them.

+1 to this proposal and for removing them in 3.13 (3.12 might be too early since thats only 1 version of warnings).

@srittau
Copy link
Contributor Author

@srittau srittau commented May 14, 2021

I have now added a deprecation notice instead of removing mentioning them completely. I marked them as deprecated as of 3.8 (since that was the version where they were removed first from the docs according to the NEWS entry). I also used a removal version of 3.12 for now. Since they were never supported, I'd be surprised if removing them has much of an impact. Also, the fix is very easy and works with all typing versions.

@JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented May 14, 2021

Looks like you may not have pushed your changes.

@srittau
Copy link
Contributor Author

@srittau srittau commented May 14, 2021

Looks like you may not have pushed your changes.

Oops. Done now.

@github-actions
Copy link

@github-actions github-actions bot commented Jun 14, 2021

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Jun 14, 2021
Copy link
Member

@gvanrossum gvanrossum left a comment

I feel this needs a NEWS entry. If you add one I will merge it. I'll also mark it for backporting.

@srittau
Copy link
Contributor Author

@srittau srittau commented Jun 14, 2021

@gvanrossum Done.

@gvanrossum gvanrossum merged commit 8a76683 into python:main Jun 14, 2021
13 checks passed
@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jun 14, 2021

Thanks @srittau for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.9.
🐍🍒🤖

miss-islington added a commit to miss-islington/cpython that referenced this issue Jun 14, 2021
…26113)

They were originally removed in pythonGH-10173 per bpo-35089, but then
readded in pythonGH-21574. Cf. bpo-38291 for decision to remove.
(cherry picked from commit 8a76683)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Jun 14, 2021

GH-26720 is a backport of this pull request to the 3.10 branch.

miss-islington added a commit to miss-islington/cpython that referenced this issue Jun 14, 2021
…26113)

They were originally removed in pythonGH-10173 per bpo-35089, but then
readded in pythonGH-21574. Cf. bpo-38291 for decision to remove.
(cherry picked from commit 8a76683)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Jun 14, 2021

GH-26721 is a backport of this pull request to the 3.9 branch.

miss-islington added a commit that referenced this issue Jun 14, 2021
They were originally removed in GH-10173 per bpo-35089, but then
readded in GH-21574. Cf. bpo-38291 for decision to remove.
(cherry picked from commit 8a76683)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
miss-islington added a commit that referenced this issue Jun 14, 2021
They were originally removed in GH-10173 per bpo-35089, but then
readded in GH-21574. Cf. bpo-38291 for decision to remove.
(cherry picked from commit 8a76683)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
@srittau srittau deleted the remove-typing-io-re branch Jun 14, 2021
jdevries3133 added a commit to jdevries3133/cpython that referenced this issue Jun 19, 2021
…26113)

They were originally removed in pythonGH-10173 per bpo-35089, but then
readded in pythonGH-21574. Cf. bpo-38291 for decision to remove.
JuniorJPDJ added a commit to JuniorJPDJ/cpython that referenced this issue Aug 12, 2021
…26113)

They were originally removed in pythonGH-10173 per bpo-35089, but then
readded in pythonGH-21574. Cf. bpo-38291 for decision to remove.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants