Replace quoted-list generated docstrings with static docstrings - #1651
Replace quoted-list generated docstrings with static docstrings#1651cakeni wants to merge 8 commits into
Conversation
AI-Assisted-By: OpenAI Codex (GPT-5) AI-Use: Used Codex to inspect issue collective#1650 and the repository contribution policy, draft the focused refactor, and verify it with parameter tests, doctests, Ruff, Towncrier, and a Sphinx documentation build.
|
This pull request did not pass quality checks and AI use is suspected. Please review Contribute and make any necessary amendments. |
|
Profile summary: Full profile |
stevepiercy
left a comment
There was a problem hiding this comment.
Although I thought this would be a good idea, I'm having second thoughts. Please see my comment.
| DELEGATED_FROM = quoted_list_parameter("DELEGATED-FROM") | ||
| """Specify the calendar users that delegated their participation. |
There was a problem hiding this comment.
This has an interesting side effect, and I'm not sure whether it's better or worse. The docstring previously appeared in the context of:
It got moved to:
I think that makes it less useful because it loses its practical context. @niccokunzmann @cakeni what do you think? AI doesn't think.
Similar behavior occurred for DELEGATED_TO, but not MEMBER which appears to have been omitted by accident.
@niccokunzmann should MEMBER be treated the same as other CAL-ADDRESS parameters? This appears to be a bug.
There was a problem hiding this comment.
Thanks, I dug into this more carefully, and I agree that moving the docs to icalendar.param loses useful context.
Previously, quoted_list_parameter() passed the docstring into the property itself, so Sphinx could show it under vCalAddress.DELEGATED_FROM and vCalAddress.DELEGATED_TO. With the current static attribute docstrings, Sphinx instead associates them with icalendar.param.
I think the cleaner approach is to keep the descriptor implementation in icalendar.param, but put the static documentation on the concrete vCalAddress bindings. That keeps the docs in the practical context without duplicating them.
I also checked MEMBER: it was not missed by this PR. vCalAddress simply never exposed MEMBER, unlike DELEGATED_FROM and DELEGATED_TO, so this looks like a pre-existing inconsistency. Adding it would be a new public API, though, so I don't want to include that without maintainer confirmation.
Would you prefer that I keep #1651 limited to fixing the documentation location and handle MEMBER separately, or make all three consistent here?
There was a problem hiding this comment.
Member should be treated the same as the others. That is a mistake.
The change can be in here or in a follow up PR.
There was a problem hiding this comment.
This is the way, variables are documented. Nice feature.
|
This PR uses the same idea as the one in #1652. Could you help me understand why you @cakeni and @floze-the-genius have chosen this path? Did you talk to each other? The change that I see is that now, we document in a different place. Beforeproperty holds the docs class1.PROP = class2.PROP = PROPERTY class1.PROP and class2.PROP have the same docs Nowattribute is documented class1.PROP = class2.PROP = PROPERTY class1.PROP has documentation distinct from class2.PROP EvaluationThis is a documentation design decision. They use a 'newer' language feature. This increases the amount of documentation and possible duplication and inconsistency. However, it also allows tailoring the documentation of the property to the specific class that it lives in. What are your thoughts? |
I hadn’t seen #1652 and didn’t discuss this with the author. This just seemed like the simplest way to keep the code shared while putting the docs where people would expect them. I’d keep it limited to these parameters for now. |
stevepiercy
left a comment
There was a problem hiding this comment.
Thank you for the changes.
|
@niccokunzmann this LGTM. Have all your unresolved comments been addressed? |
Linked issue
Description
Moves quoted_list_parameter and its three callers from generated property docs to static Sphinx-visible attribute docstrings. Covers part of the seven-factory issue. AI use is disclosed in the commit and news fragment.
Checklist
Additional information
55 focused tests, targeted doctest, Ruff, format, diff, AST, and Towncrier pass; generated HTML includes them. Full Windows pytest hit an unrelated CRLF failure after 9,196 passes. Sphinx -W completed pages but hit 12 existing include warnings.