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

Minor mistake in dataclasses documentation update #108267

Closed
Labels
3.11only security fixes3.12only security fixes3.13bugs and security fixesdocsDocumentation in the Doc dir
@FrozenBob

Description

@FrozenBob

Anupdate to the dataclasses docs, intended to make magic method names link to the relevant data model documentation, accidentally changed a line that shouldn't have been changed.

The docs used to say

There is a tiny performance penalty when usingfrozen=True:__init__() cannot use simple assignment to initialize fields, and must useobject.__setattr__().

The documentation update accidentally changedobject.__setattr__ to just__setattr__ here, so now it reads

There is a tiny performance penalty when usingfrozen=True:__init__() cannot use simple assignment to initialize fields, and must use__setattr__().

This line was specifically meant to refer toobject.__setattr__, the__setattr__ method of the baseobject class, as simple attribute assignment would hit the frozen dataclass's__setattr__ override.

This part of the documentation should be reverted. I think it should just take a 1-character change, simply removing a tilde.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixes3.12only security fixes3.13bugs and security fixesdocsDocumentation in the Doc dir

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp