Commit Graph

8 Commits

Author SHA1 Message Date
Adam Turner
00ad109a39 Run Ruff on `tests/roots/` 2025-01-03 01:33:14 +00:00
Adam Turner
4032070e81
Run pyupgrade (#11070) 2023-01-02 00:01:14 +00:00
Adam Turner
f4c8a0a68e Insert `from __future__ import annotations` 2023-01-01 20:48:37 +00:00
Takeshi KOMIYA
d88166e84b Close #8514: autodoc: Default values of overloads are taken from actual implementation
As a well-known idiom, mypy recommends to use ellipsis ("...") for
default argument values as a elided style.  This allows to write the
style and helps to document it with copying the default argument
values from actual implementation.

Note: This does not copy the default argument value when the argument
of overloaded function has its own default value.
2021-01-17 02:32:50 +09:00
Takeshi KOMIYA
425cd1af02 Fix #8693: autodoc: Default values for overloads are rendered as string
The default values for overloaded functions are rendered as string
literal unexpectedly because autodoc extracts code snippets from
the source code, not actual value (ex. int, ellipsis, and so on).

This introduces a simple wrapper class; `DefaultValue` to render these
code snippets like actual values, not string literals.
2021-01-17 02:30:20 +09:00
Takeshi KOMIYA
916cd4c844 Fix #7901: autodoc: annotations for overloaded functions are not resolved
So far, type annotations for overloaded functions are not resolved
because they are obtained from AST directly.  This tries to evaluate
them using a context of its function or method.
2020-07-11 12:49:24 +09:00
Takeshi KOMIYA
49de4ab1a1 Support overloaded constructors (__call__, __init__ and __new__) 2020-06-02 00:44:07 +09:00
Takeshi KOMIYA
fb2f777079 Close #3610: autodoc: Support overloaded functions 2020-05-31 23:59:32 +09:00