Skip to content

Commit

Permalink
docs: add another slots caveat
Browse files Browse the repository at this point in the history
Fixes #1211
  • Loading branch information
hynek committed Dec 29, 2023
1 parent 9204fd9 commit 84274fd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ slotted classes
- The {attr}`class.__subclasses__` attribute needs a garbage collection run (which can be manually triggered using {func}`gc.collect`), for the original class to be removed.
See issue [#407](https://github.com/python-attrs/attrs/issues/407) for more details.
- Pickling of slotted classes will fail if you define a class with missing attributes.
This situation can occur if you define an `attrs.field(init=False)` and don't set the attribute by hand before pickling.
:::
[^pypy]: On PyPy, there is no memory advantage in using slotted classes.
Expand Down

0 comments on commit 84274fd

Please sign in to comment.