| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
I'm trying to understand the problem: The Directive.options is sub-class specific, so ideally each sub-class would type it as a TypedDict. And in the PR you linked, you would ideally also return a TypedDict from _options_with_language_defaults and use that as argument to _common_option_args. Is that correct? Where and how would you defined the accepted fields? Like this? class FooDirective(Directive[MyTypedDict]):
...Would this work at the moment? class FooDirective(Directive):
options: MyTypedDict |
Sorry, something went wrong.
|
Diff from mypy_primer, showing the effect of this PR on open source code: sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/domains/python/_object.py:440: error: Unused "type: ignore" comment [unused-ignore]
|
Sorry, something went wrong.
|
Thank you for the review @srittau . I'm experimenting and iterating before answering! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Closes #16400.
Allow subclasses to type Directive.options as a TypedDict; Docutils
documents that converted values depend on each directive.
The constructor still accepts dict[str, Incomplete].
Agent: Codex.