KEMBAR78
Crossreferences to standard library in mypy docs by hoefling · Pull Request #7652 · python/mypy · GitHub
Skip to content

Conversation

@hoefling
Copy link
Contributor

@hoefling hoefling commented Oct 7, 2019

Added references to the following documents:

  • additional_features.rst
  • casts.rst
  • class_basics.rst
  • command_line.rst

This is part of splitting up the changes in #7624 into more readable PRs.

Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just two actionable nits.

have imprecise (too permissive) types. This will be fixed in future releases.

Mypy does not yet recognize aliases of ``dataclasses.dataclass``, and will
Mypy does not yet recognize aliases of :py:func:`dataclasses.dataclass`, and will
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one causes is a regression in rendering IMO. The :py:func: version gets rendered with a trailing () pair, while the original gets rendered without it. Since an alias to a function does not involve calling it, IMO it should be rendered without (). (Maybe one of the other :py: things link the same way but render without ()?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dang, missed that. Sure, the proper ref here would be

:py:func:`dataclasses.dataclass <dataclasses.dataclass>`

Will fix that!

…in command_line.rst

Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG! Will merge.

BTW What does the ~ in ~typing.Optional do?

@gvanrossum gvanrossum merged commit f86b422 into python:master Oct 8, 2019
@hoefling
Copy link
Contributor Author

hoefling commented Oct 8, 2019

The tilde removes the dotted path in the rendered text. E.g.

:py:class:`foo.bar.baz.Spam`

will render as foo.bar.baz.Spam, while

:py:class:`~foo.bar.baz.Spam`

will render as just Spam. However, the link will be identical in both cases.

@hoefling hoefling deleted the stdlib-crossref-1 branch October 8, 2019 23:15
JukkaL pushed a commit that referenced this pull request Jul 31, 2020
This adds crossrefs to the docs, a follow-up of #7652 (crossrefs to standard 
library items) and #7784 (crossrefs for command line options), only now for 
the config file values.

Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants