python / cpython

The Python programming language
https://www.python.org
Other
62.35k stars 29.94k forks source link

Incorrect slot check: typo in `__dictoffset__` #123935

Open sobolevn opened 6 days ago

sobolevn commented 6 days ago

Bug report

I made a typo that made it into the final code: https://github.com/python/cpython/blob/00ffdf27367fb9aef247644a96f1a9ffb5be1efe/Lib/dataclasses.py#L1211-L1212

It should had been __dictoffset__ not __dictrefoffset__.

Fixing plan:

Linked PRs

picnixz commented 6 days ago

Out of curiosity... how did you find it?

sobolevn commented 6 days ago

I have a telegram channel, where I post different Python-related posts. Today I posted about how slots work in dataclasses. And one of my readers found this typo :)