Skip to content

Commit

Permalink
Fix docs for NOTHING
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinMGranger committed Aug 8, 2022
1 parent 36d942a commit 2358f8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Core
Therefore if a class, method, or function claims that it has been added in an older version, it is only available in the ``attr`` namespace.

.. autodata:: attrs.NOTHING
:no-value:

.. autofunction:: attrs.define

Expand Down
8 changes: 4 additions & 4 deletions src/attr/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@

class _Nothing(enum.Enum):
"""
Sentinel class to indicate the lack of a value when ``None`` is ambiguous.
Sentinel to indicate the lack of a value when ``None`` is ambiguous.
This is an Enum so that the single variant can be used as a `Literal` for
type checking tools.
If extending attrs, you can use ``typing.Literal[NOTHING]`` to show
that a value may be ``NOTHING``.
.. versionchanged:: 21.1.0 ``bool(NOTHING)`` is now False.
.. versionchanged:: 22.2.0 ``NOTHING`` is now an `enum.Enum` variant.
.. versionchanged:: 22.2.0 ``NOTHING`` is now an ``enum.Enum`` variant.
"""

NOTHING = enum.auto()
Expand Down

0 comments on commit 2358f8e

Please sign in to comment.