Join "optional" and "extra_info" rules in grammar #70
+50
−43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since the "optional" statement isn't used in any way right now, enforcing a specific layout for what comes after the "doctype" serves no useful purpose. I don't intend docstub to be linter so I don't think it's likely that we will ever enforce annotating that a parameter is "optional" in the docstring – while it's nice to do so, it's reasonably easy to see it from the signature.
This also makes it easy to add info like requested in #65. It's not used in any way but it's possible to include in docstrings. Docstub shouldn't make it harder writing rich docstrings if possible.
Update the docs accordingly. Also try to be more precise about differentiating "doctypes" from valid Python types.
Release note
For maintainers and optionally contributors, please refer to changelist's README on how to document this PR for the release notes.