Skip to content

new rule - duplicate KW_ONLY in dataclass #3737

Closed

Description

@DetachHead
from dataclasses import dataclass, KW_ONLY

@dataclass
class A:  # Crash at runtime
    b: int
    _1: KW_ONLY
    c: str
    _2: KW_ONLY
    d: bytes

https://docs.astral.sh/ty/reference/rules/#duplicate-kw-only

Activity

  1. added
    help wantedLarger than "good first issue", but still well-defined and ready for someone to pick up
    on Jun 10, 2026
  2. Photon101 commented on Jun 10, 2026

    @Photon101

    I can take a look at this. I plan to add a focused type-checker test for duplicate dataclasses.KW_ONLY markers and wire the diagnostic into the existing dataclass field handling.

  3. github-actions commented on Jul 2, 2026

    @github-actions

    This issue has someone assigned, but has not had recent activity for more than 2 weeks.

    If you are still working on this issue, please add a comment so everyone knows. Otherwise, please unassign yourself and allow someone else to take over.

    Thank you for your contributions!

  4. added and removed
    help wantedLarger than "good first issue", but still well-defined and ready for someone to pick up
    on Jul 23, 2026
  5. vivekjm commented on Jul 30, 2026

    @vivekjm
    Contributor

    I’m picking this up and will add a focused regression test with the existing dataclass diagnostics. #claim

  6. github-actions commented on Jul 30, 2026

    @github-actions

    @vivekjm you've claimed this issue — it's now assigned to you. Thanks for picking it up! 🎉

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions