docs: clarify Event.new() optional and auto-generated properties - #1504
docs: clarify Event.new() optional and auto-generated properties#1504checkzhao8888 wants to merge 1 commit into
Conversation
Align Event.new() parameter documentation with RFC terminology by marking optional arguments explicitly and documenting auto-generated UID and DTSTAMP values. See collective#1473 AI: Grok — reviewed Event.required, Calendar.new (collective#1459), and Alarm.new PR patterns; drafted the docstring wording.
|
Profile summary: Full profile |
| summary: The :attr:`summary` of the event. | ||
| transparency: The :attr:`transparency` of the event. | ||
| If ``None``, this is set to the current UTC time. | ||
| start: Optional. The :attr:`start` of the event. |
There was a problem hiding this comment.
Misleading since it is not true in all cases. Please manually check the RFC.
There was a problem hiding this comment.
Also, do not write Optional. That is covered by typing.
There was a problem hiding this comment.
Good point. @checkzhao8888, please remove the Optional. Then this should be a small change. If you want, you can include the condition when start is required but please word it so that users understand, that they can specify it later. You may also add that this validates start <= end iff. both where specified.
If you do not want to continue with this, I will close this PR in one week.
There was a problem hiding this comment.
I agree with @niccokunzmann to remove all the "Optional. "s.
|
@angatha, I will assign this to you. I cannot wrap my head around wether this is useful. Feel free to call in steve or close it if there is no response. |
| summary: The :attr:`summary` of the event. | ||
| transparency: The :attr:`transparency` of the event. | ||
| If ``None``, this is set to the current UTC time. | ||
| start: Optional. The :attr:`start` of the event. |
There was a problem hiding this comment.
Good point. @checkzhao8888, please remove the Optional. Then this should be a small change. If you want, you can include the condition when start is required but please word it so that users understand, that they can specify it later. You may also add that this validates start <= end iff. both where specified.
If you do not want to continue with this, I will close this PR in one week.
stevepiercy
left a comment
There was a problem hiding this comment.
With the suggested changes, I will approve. Thank you!
| summary: The :attr:`summary` of the event. | ||
| transparency: The :attr:`transparency` of the event. | ||
| If ``None``, this is set to the current UTC time. | ||
| start: Optional. The :attr:`start` of the event. |
There was a problem hiding this comment.
I agree with @niccokunzmann to remove all the "Optional. "s.
| url: str | None = None, | ||
| ): | ||
| """Create a new event with all required properties. | ||
| """Create a new event. |
There was a problem hiding this comment.
I often wonder what are the required properties, so this suggestion would help stop me from wondering. The properties are the Python representations of DTSTAMP and UID.
| """Create a new event. | |
| """Create a new event with the required properties of ``stamp`` and ``uid``. |
| """Create a new event with all required properties. | ||
| """Create a new event. | ||
|
|
||
| This creates a new Event in accordance with :rfc:`5545`. |
There was a problem hiding this comment.
| This creates a new Event in accordance with :rfc:`5545`. | |
| This creates a new ``Event`` in accordance with :rfc:`5545#section-3.6.1`. |
Linked issue
newclass methods #1473Description
Clarifies the
Event.new()docstring to align with RFC terminology used elsewhere in the project (for example, #1459 forCalendar.new()).Changes:
UIDandDTSTAMPvalues when arguments areNone.AI disclosure: Grok assisted with reviewing RFC terminology, comparing existing
new()docstring patterns, and drafting the update.Checklist
/news, following the instructions in Change log entry format.