GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Deprecate typing.Hashable/Sized · Issue #94309 · python/cpython

Deprecate typing.Hashable/Sized #94309

New issue
Copy link
New issue
Copy link
Closed
Closed
Deprecate typing.Hashable/Sized#94309
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc direasytopic-typingtype-featureA feature request or enhancementA feature request or enhancement

Description

@Numerlor
Numerlor
opened on Jun 26, 2022
Issue body actions

typing.Hashable and typing.Sized are aliases to their equivalents in the collections.abc module; PEP 585 deprecated all aliases like these while aiming to remove the duplication between the two modules, but the aforementioned two seem to have been left out of that because they're not generic.

If the others are deprecated, I don't think it makes sense to keep them when they're just aliases that provide no additional functionality

Linked PRs

  • gh-94309: py312 "what's new": improve deprecation notice for typing.Hashable and typing.Sized #112196
  • [3.12] gh-94309: "What's new in Python 3.12": improve deprecation notice for typing.Hashable and typing.Sized (GH-112196) #112200
Reacted by Jelle Zijlstra and Alex Waygood

Activity

  1. AlexWaygood
    added
    topic-typing
    type-featureA feature request or enhancementA feature request or enhancement
    on Jun 26, 2022
  2. Fidget-Spinner commented on Jun 27, 2022

    @Fidget-Spinner
    Fidget-Spinner
    on Jun 27, 2022
    Member
    More actions

    I'm +1 for deprecating them too. Before that, I'm interested as to why we have these aliases in typing? Are they just for convenience? Searching commit history, I think @gvanrossum might have an idea.

  3. AlexWaygood commented on Jun 27, 2022

    @AlexWaygood
    AlexWaygood
    on Jun 27, 2022
    Member
    More actions

    Are they just for convenience?

    According to PEP 484: yup! For both Sized and Hashable, PEP 484 states that they are "not generic, but present [in the proposed new typing module] for completeness": https://peps.python.org/pep-0484/#the-typing-module

  4. gvanrossum commented on Jun 27, 2022

    @gvanrossum
    gvanrossum
    on Jun 27, 2022
    Member
    More actions

    I agree that we should be consistent.

  5. Fidget-Spinner
    added
    easy
    on Jun 30, 2022
  6. MonadChains commented on Jul 5, 2022

    @MonadChains
    MonadChains
    on Jul 5, 2022
    Contributor
    More actions

    Hi, I'm new to the Python codebase, and I would like to contribute to it. I have a question about this issue: what is the deprecation procedure for the aliases? According to PEP 585, the deprecated aliases should not trigger any DeprecationWarning and only type checkers should warn of their usage. So I'm not sure what are exactly the changes needed.

  7. JelleZijlstra commented on Jul 5, 2022

    @JelleZijlstra
    JelleZijlstra
    on Jul 5, 2022
    Member
    More actions

    I think we should just add a deprecation notice in the docs, similar to that for typing.Iterable and similar. We don't need any runtime behavior change.

    Reacted by Alex Waygood and MonadChains
  8. Fidget-Spinner
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    on Jul 6, 2022
  9. Fidget-Spinner commented on Jul 6, 2022

    @Fidget-Spinner
    Fidget-Spinner
    on Jul 6, 2022
    Member
    More actions

    @MonadChains thanks for your interest in contributing. Here's what you have to do after cloning cpython.

    1. Go to /Doc/library/typing.rst.
    2. Copy one of the .. deprecated:: notices and paste it under the appropriate sections those types. Edit the text saying to use the type in collections.abc
    3. Build the documentation with either make html or ./Doc/make.bat html. View the html output in ./Doc/build/.
    4. The file uses reStructuredText for documentation. I suggest reading this guide as there may be surprising things to beginners (such as indents using 3 spaces instead of 4!).
    Reacted by Alex Waygood and MonadChains
  10. MonadChains
    added a commit that references this issue on Jul 6, 2022

    pythongh-94309: Deprecate typing.Hashable/Sized

    b916294
  11. Fidget-Spinner
    added a commit that references this issue on Jul 10, 2022

    gh-94309: Deprecate typing.Hashable/Sized (GH-94626)

    e8e4b55
  12. AlexWaygood commented on Jul 10, 2022

    @AlexWaygood
    AlexWaygood
    on Jul 10, 2022
    Member
    More actions

    Fixed in #94626. Thanks @MonadChains! 🎉

    Reacted by MonadChains
  13. AlexWaygood
    closed this as completedon Jul 10, 2022
  14. AlexWaygood commented on Jul 10, 2022

    @AlexWaygood
    AlexWaygood
    on Jul 10, 2022
    Member
    More actions

    Reopening as per #94626 (comment)

  15. AlexWaygood
    reopened this on Jul 10, 2022
  16. MonadChains commented on Jul 10, 2022

    @MonadChains
    MonadChains
    on Jul 10, 2022
    Contributor
    More actions

    Reopening as per #94626 (comment)

    I've opened a new pull request to add the missing part.

    Reacted by Hugo van Kemenade
  17. Fidget-Spinner
    added a commit that references this issue on Jul 14, 2022

    gh-94309: Add typing.Hashable and typing.Sized for "What's New for Py…

    b03a9e8
  18. Fidget-Spinner
    closed this as completedon Jul 14, 2022
  19. salty-horse
    added 2 commits that reference this issue on Nov 17, 2023

    pythongh-94309: Fix documentation for deprecated aliases

    2f7fa98

    pythongh-94309: Fix documentation for deprecated aliases

    5a776e7
  20. AlexWaygood
    added a commit that references this issue on Nov 17, 2023

    gh-94309: "What's new in Python 3.12": improve deprecation notice for…

    fb4cddb
  21. miss-islington
    added a commit that references this issue on Nov 17, 2023

    pythongh-94309: "What's new in Python 3.12": improve deprecation noti…

    4ebc12c
  22. AlexWaygood
    added a commit that references this issue on Nov 17, 2023

    [3.12] gh-94309: "What's new in Python 3.12": improve deprecation not…

    976488e
  23. aisk
    added a commit that references this issue on Feb 11, 2024

    pythongh-94309: "What's new in Python 3.12": improve deprecation noti…

    74261c7
  24. Glyphack
    added a commit that references this issue on Sep 2, 2024

    pythongh-94309: "What's new in Python 3.12": improve deprecation noti…

    fc6b30a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirDocumentation in the Doc direasytopic-typingtype-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.