Use the docstring descriptions of enums when they are present

This commit is contained in:
Firas Kafri 2023-05-04 10:54:33 +03:00 committed by GitHub
parent ee60ad08c2
commit 42471516c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,7 +63,7 @@ class EnumMeta(SubclassWithMeta_Meta):
cls, enum, name=None, description=None, deprecation_reason=None
): # noqa: N805
name = name or enum.__name__
description = description or "An enumeration."
description = description or enum.__doc__ or "An enumeration."
meta_dict = {
"enum": enum,
"description": description,