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 — Implement PEP 681 (@dataclass_transform) · Issue #91860 · python/cpython

Implement PEP 681 (@dataclass_transform) #91860

New issue
Copy link
New issue
Copy link
Closed
Closed
Implement PEP 681 (@dataclass_transform)#91860
Copy link
Labels
topic-typingtype-featureA feature request or enhancementA feature request or enhancement

Description

@JelleZijlstra
JelleZijlstra
opened on Apr 23, 2022
Issue body actions

The SC has given the green light to implement PEP 681 in Python 3.11: https://mail.python.org/archives/list/[email protected]/thread/JWMSWJ6JZJNNG3JKPBYDMQUUHZFD2FZL/

I'll send a PR shortly to add the runtime implementation. As with PEP 655, I'll hold off on documentation to make sure we get the runtime code in before the feature freeze in a few weeks.

cc @debonte @erictraut

Activity

  1. JelleZijlstra
    added
    type-featureA feature request or enhancementA feature request or enhancement
    topic-typing
    on Apr 23, 2022
  2. JelleZijlstra
    added a commit that references this issue on Apr 23, 2022

    pythongh-91860: Add typing.dataclass_transform (PEP 681)

    9a5bcc3
  3. bluetech commented on Apr 23, 2022

    @bluetech
    bluetech
    on Apr 23, 2022
    Contributor
    More actions

    Is there an intention to apply @dataclass_transform to dataclasses.dataclass itself?

  4. JelleZijlstra commented on Apr 23, 2022

    @JelleZijlstra
    JelleZijlstra
    on Apr 23, 2022
    MemberAuthor
    More actions

    Is there an intention to apply @dataclass_transform to dataclasses.dataclass itself?

    I haven't considered it. For performance reasons dataclasses.py avoids importing typing, which presents a problem for doing it at runtime. We could apply the decorator in typeshed, probably based on feedback from type checker authors.

  5. bluetech commented on Apr 23, 2022

    @bluetech
    bluetech
    on Apr 23, 2022
    Contributor
    More actions

    If it is decided to apply it in typeshed, the effect of the decorator (the __dataclass_transform__ attribute) can be added manually to dataclass, perhaps with some test to ensure consistency.

    Reacted by Jelle Zijlstra
  6. erictraut commented on Apr 23, 2022

    @erictraut
    erictraut
    on Apr 23, 2022
    Contributor
    More actions

    I don't see any benefit to using @dataclass_transform with dataclass.dataclass. All existing type checkers already know about dataclass.

  7. JelleZijlstra
    added a commit that references this issue on Apr 26, 2022

    gh-91860: Add typing.dataclass_transform (PEP 681) (#91861)

    5397b5a
  8. hauntsaninja
    added a commit that references this issue on May 13, 2022

    pythongh-91860: documentation for typing.dataclass_transform

    d580df7
  9. JelleZijlstra
    added a commit that references this issue on May 20, 2022

    gh-91860: documentation for typing.dataclass_transform (#92768)

    f20a6a5
  10. miss-islington
    added 2 commits that reference this issue on May 20, 2022

    pythongh-91860: documentation for typing.dataclass_transform (pythonG…

    9b50e8f

    gh-91860: documentation for typing.dataclass_transform (GH-92768)

    6a3a6ba
  11. ambv
    added a commit that references this issue on Jun 28, 2022

    gh-91860: Add docs for typing.dataclass_transform field specifier par…

    64365d0
  12. hauntsaninja commented on Oct 10, 2022

    @hauntsaninja
    hauntsaninja
    on Oct 10, 2022
    Contributor
    More actions

    I think all work here has been done

  13. hauntsaninja
    closed this as completedon Oct 10, 2022
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

    topic-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 01402520 — 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.