Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

match_args,slots and possiblykw_only missing from__dataclass_params__ #96142

Closed
Assignees
ericvsmith
Labels
stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error
@da-woods

Description

@da-woods

Bug report

Dataclasses have an undocumented__dataclass_params__ class-attribute which appears to document the flags sent to thedataclass decorator:

setattr(cls,_PARAMS,_DataclassParams(init,repr,eq,order,
unsafe_hash,frozen))

A few new flags have been added since the initial implementation of dataclasses. These don't seem to have been added to the__dataclass_params__ field. In the case ofkw_only I think that makes sense - it's effectively controlled at a per-field level and the parameter to thedataclass decorator is just a convenience. However, the others seem like a genuine omission.

Your environment

I've just looked at the code for the current main branch.

Metadata

Metadata

Assignees

Labels

stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp