This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sobolevn
Recipients IanLee1521, sobolevn
Date 2022-01-27.15:26:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1643297189.0.0.126410360252.issue46550@roundup.psfhosted.org>
In-reply-to
Content
It does not happen on `3.11` (main):

```
Python 3.11.0a4+ (heads/main-dirty:ef3ef6fa43, Jan 20 2022, 20:48:25) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class A:
...   __slots__ = ('x',)
... 
>>> A.__slots__ += ('y',)
>>> A.__slots__
('x', 'y')

>>> a = A()
>>> a.__slots__ 
('x', 'y')
>>> a.__slots__ += ('z',)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'A' object attribute '__slots__' is read-only

>>> a.__slots__
('x', 'y')
```

It also does not happen on `3.9`:

```
Python 3.9.9 (main, Dec 21 2021, 11:35:28) 
[Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class A:
...   __slots__ = ('x',)
... 
>>> a = A()
>>> a.__slots__ += ('y',)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'A' object attribute '__slots__' is read-only

>>> a.__slots__
('x',)
```
History
Date User Action Args
2022-01-27 15:26:29sobolevnsetrecipients: + sobolevn, IanLee1521
2022-01-27 15:26:29sobolevnsetmessageid: <1643297189.0.0.126410360252.issue46550@roundup.psfhosted.org>
2022-01-27 15:26:28sobolevnlinkissue46550 messages
2022-01-27 15:26:28sobolevncreate