-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Crossreferences to standard library in mypy docs, part 3 #7677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
docs/source/error_code_list.rst
Outdated
@@ -415,11 +415,11 @@ Example: | |||
# Error: Dict entry 0 has incompatible type "str": "str"; expected "str": "int" [dict-item] | |||
d: Dict[str, int] = {'key': 'value'} | |||
|
|||
Check TypedDict items [typeddict-item] | |||
-------------------------------------- | |||
Check ``TypedDict`` items [typeddict-item] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks better without the heavy formatting. TBH I find most CSS styling for code blocks over the top, and red is particularly bad in a heading. I also don't care about the box (or shading in other CSS setups).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree. IMO the best solution is simply use monospaced font for verbatim formatting like Python stdlib docs do that (and afaik Javadoc too). If you don't mind, I will also replace other occurences of verbatim text in section titles in this PR.
|
||
**get_attribute_hook** overrides instance member field lookups and property | ||
**get_attribute_hook()** overrides instance member field lookups and property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All other paragraphs use parentheses in hook names, I suppose they were omitted by mistake here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
module. For example, to indicate that some function can accept a list of | ||
strings, use the ``List`` type from the ``typing`` module: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second change unrelated to referencing. IMO with the List
reference, there's no need to mention the module again - it's also referenced one line above that. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
(PS. When commenting on a diff chunk, please attach the comment to the last line, so the context in email or in the Conversation view is clearer. I think you can now also shift-click to attach a comment to a range of lines.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it!
@@ -164,7 +163,7 @@ monkey patching of methods. | |||
How is mypy different from Cython? | |||
********************************** | |||
|
|||
`Cython :doc:<cython:index>` is a variant of Python that supports | |||
:doc:`Cython <cython:index>` is a variant of Python that supports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing my own errors here. No idea why Sphinx didn't catch this on build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't you have to run it with special flags to check errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did (using sphinx-build -WEan
), however Sphinx ignores markup errors and just renders the text as-is. Neither does doc8
nor restructuredtext-lint
, sadly.
@@ -98,7 +98,7 @@ High-level overview | |||
******************* | |||
|
|||
Every entry point function should accept a single string argument | |||
that is a full mypy version and return a subclass of ``mypy.plugins.Plugin``: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of two changes in this PR that are not related to referencing, typo fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't mean to send every comment as a separate email. And I'm not done, but wanted to reply to all your questions first.
module. For example, to indicate that some function can accept a list of | ||
strings, use the ``List`` type from the ``typing`` module: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
(PS. When commenting on a diff chunk, please attach the comment to the last line, so the context in email or in the Conversation view is clearer. I think you can now also shift-click to attach a comment to a range of lines.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, except I think you should get rid of all the code markup in headings.
@@ -164,7 +163,7 @@ monkey patching of methods. | |||
How is mypy different from Cython? | |||
********************************** | |||
|
|||
`Cython :doc:<cython:index>` is a variant of Python that supports | |||
:doc:`Cython <cython:index>` is a variant of Python that supports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't you have to run it with special flags to check errors?
…, final_attrs.rst Signed-off-by: Oleg Höfling <[email protected]>
Signed-off-by: Oleg Höfling <[email protected]>
829e8fc
to
bfdfc3d
Compare
Signed-off-by: Oleg Höfling <[email protected]>
bfdfc3d
to
e497d2d
Compare
Added references to the following documents:
error_code_list.rst
error_code_list2.rst
extending_mypy.rst
faq.rst
final_attrs.rst
getting_started.rst
This is part of splitting up the changes in #7624 into more readable PRs.