Always check for `__dictrefoffset__` and `__weakoffset__` in `dataclasses` with slots · Issue #118829 · python/cpython · GitHub
Skip to content

Always check for __dictrefoffset__ and __weakoffset__ in dataclasses with slots #118829

Description

@sobolevn

Bug report

See #118099 (comment) and #118033

We now correctly check for __dictoffset__ and __weakoffset__ on C types without __slots__ defined:

cpython/Lib/dataclasses.py

Lines 1201 to 1212 in c68acb1

But, not in this case:

cpython/Lib/dataclasses.py

Lines 1213 to 1218 in c68acb1

So, in theory there might be C types with __slots__ and __dictoffset__ and __weakoffset__.

I will investigate!

Activity

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

Metadata

Metadata

Assignees

Labels

stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions