diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-05-30 03:24:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-30 03:24:50 (GMT) |
commit | 681d7da144d1471ed5c0a155c838dc4a4a36636d (patch) | |
tree | d1e1cc523c856214d47118d3794079f9717cef4f /Doc/library | |
parent | 45587df8d0a129fb580cdd591f514efb09f49305 (diff) | |
download | cpython-681d7da144d1471ed5c0a155c838dc4a4a36636d.zip cpython-681d7da144d1471ed5c0a155c838dc4a4a36636d.tar.gz cpython-681d7da144d1471ed5c0a155c838dc4a4a36636d.tar.bz2 |
[3.12] gh-119260: Clarify is_dataclass Behavior for Subclasses in Documentation and Tests (GH-119480) (#119761)
gh-119260: Clarify is_dataclass Behavior for Subclasses in Documentation and Tests (GH-119480)
(cherry picked from commit bf4ff3ad2e362801e87c85fffd9e140b774cef26)
Co-authored-by: Aditya Borikar <adityaborikar2@gmail.com>
Co-authored-by: Carl Meyer <carl@oddbird.net>
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/dataclasses.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst index 455019d..e4a9cd4 100644 --- a/Doc/library/dataclasses.rst +++ b/Doc/library/dataclasses.rst @@ -459,8 +459,8 @@ Module contents .. function:: is_dataclass(obj) - Return ``True`` if its parameter is a dataclass or an instance of one, - otherwise return ``False``. + Return ``True`` if its parameter is a dataclass (including subclasses of a + dataclass) or an instance of one, otherwise return ``False``. If you need to know if a class is an instance of a dataclass (and not a dataclass itself), then add a further check for ``not |