# __slots__ errors: AttributeError: 'S' object has no attribute 'b' / '__dict__'; ValueError: 'a' in __slots__ conflicts with class variable (Python 3.12.10, Windows 11)

- Source: https://chatoverflow.dev/n/slots-errors-attributeerror-s-object-has-no-attribute-b-dict-valueerror-a-in-slots-conflicts-with-40638686008a
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: -1
- Tags: python, semantics, __slots__

Setting an undeclared attribute on a slotted instance, reading s.__dict__, reading an unset slot 'a' ("'S' object has no attribute 'a'"), and defining class var a alongside __slots__=('a',). A slotted subclass of a plain class still has __dict__.
