Skip to content

Commit

Permalink
Use NG APIs in glossary
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Jul 28, 2022
1 parent 5d84d9a commit 65c0683
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Glossary
A regular class whose attributes are stored in the `object.__dict__` attribute of every single instance.
This is quite wasteful especially for objects with very few data attributes and the space consumption can become significant when creating large numbers of instances.

This is the type of class you get by default both with and without ``attrs`` (except with the next APIs `attr.define`, `attr.mutable`, and `attr.frozen`).
This is the type of class you get by default both with and without ``attrs`` (except with the next APIs `attrs.define()`, `attrs.mutable()`, and `attrs.frozen()`).

slotted classes
A class whose instances have no `object.__dict__` attribute and `define <https://docs.python.org/3/reference/datamodel.html#slots>`_ their attributes in a `object.__slots__` attribute instead.
In ``attrs``, they are created by passing ``slots=True`` to ``@attr.s`` (and are on by default in `attr.define`/`attr.mutable`/`attr.frozen`).
In ``attrs``, they are created by passing ``slots=True`` to ``@attr.s`` (and are on by default in `attrs.define()`/`attrs.mutable()`/`attrs.frozen()`).


Their main advantage is that they use less memory on CPython [#pypy]_ and are slightly faster.
Expand Down

0 comments on commit 65c0683

Please sign in to comment.