-
-
Notifications
You must be signed in to change notification settings - Fork 244
Open
Labels
Description
When reviewing PR #1236, I found a weird docstring format.
Observe that the property has type hints that hyperlink, but the "Accepted values:" section heading is a wall of text. It's also not a standard section heading.
It's generated in this method.
icalendar/src/icalendar/attr.py
Lines 954 to 958 in bb480a9
| Accepted values: {", ".join(t.__name__ for t in value_type)}. | |
| If the attribute has invalid values, we raise InvalidCalendar. | |
| If the value is absent, we return None. | |
| You can also delete the value with del or by setting it to None. | |
| """ |
With the following snippet, it appears somewhat better.
To delete the value, either use ``del`` or set it to ``None``.
Returns:
If the value is absent, return ``None``.
Raises:
:exc:`~icalendar.error.InvalidCalendar`
If the attribute has invalid values.
I think that "Accepted values" is redundant to the type hints, so I'd remove it.
I'd keep the usage text, however, and append it to the description. This could be a problem, though, if there are other heading sections in the original docstring after the description.
@niccokunzmann what do you think?
Reactions are currently unavailable