8000 gh-105286: Improve `typing.py` docstrings by AlexWaygood · Pull Request #105287 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-105286: Improve typing.py docstrings #105287

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

Merged
merged 12 commits into from
Jun 5, 2023
Prev Previous commit
Next Next commit
Colons
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
  • Loading branch information
AlexWaygood and sobolevn authored Jun 5, 2023
commit 9f132e9fdb381d0589086a9800000a9cecb2e2df
6 changes: 3 additions & 3 deletions Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2225,7 +2225,7 @@ def get_origin(tp):
"""Get the unsubscripted version of a type.

This supports generic types, Callable, Tuple, Union, Literal, Final, ClassVar
Annotated, and others. Return None for unsupported types. Examples:
Annotated, and others. Return None for unsupported types. Examples::

assert get_origin(Literal[42]) is Literal
assert get_origin(int) is None
Expand Down Expand Up @@ -2384,7 +2384,7 @@ def overload(func):
"""Decorator for overloaded functions/methods.

In a stub file, place two or more stub definitions for the same
function in a row, each decorated with @overload. For example:
function in a row, each decorated with @overload. For example::

@overload
def utf8(value: None) -> None: ...
Expand All @@ -2395,7 +2395,7 @@ def utf8(value: str) -> bytes: ...

In a non-stub file (i.e. a regular .py file), do the same but
follow it with an implementation. The implementation should *not*
be decorated with @overload. For example:
be decorated with @overload. For example::

@overload
def utf8(value: None) -> None: ...
Expand Down
0