Skip to content
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

autodoc can't detect overloaded methods defined in other file #7786

Closed
tk0miya opened this issue Jun 4, 2020 · 0 comments
Closed

autodoc can't detect overloaded methods defined in other file #7786

tk0miya opened this issue Jun 4, 2020 · 0 comments

Comments

@tk0miya
Copy link
Member

tk0miya commented Jun 4, 2020

Describe the bug
autodoc can't detect overloaded methods defined in other file.

To Reproduce

# example.py
from typing import overload


class Foo:
    @overload
    def __init__(self, x: int) -> None:
        ...

    @overload
    def __init__(self, x: float) -> None:
        ...

    def __init__(self, x):
        return x
# example2.py
from example import Foo


class Bar(Foo):
    pass
# index.rst
.. automodule:: example2
   :members:
   :undoc-members:

Expected behavior
The constructor of Bar class should be represented as two types.

Your project
No

Screenshots
No

Environment info

  • OS: Mac
  • Python version: 3.8.2
  • Sphinx version: 3.1.0dev
  • Sphinx extensions: sphinx.ext.autodoc
  • Extra tools: No

Additional context
No

@tk0miya tk0miya added this to the 3.2.0 milestone Jun 4, 2020
@tk0miya tk0miya modified the milestones: 3.2.0, 3.3.0 Jul 26, 2020
tk0miya added a commit to tk0miya/sphinx that referenced this issue Oct 4, 2020
tk0miya added a commit to tk0miya/sphinx that referenced this issue Oct 4, 2020
tk0miya added a commit to tk0miya/sphinx that referenced this issue Oct 5, 2020
@tk0miya tk0miya closed this as completed in 6dbe28a Oct 5, 2020
tk0miya added a commit that referenced this issue Oct 5, 2020
Fix #7786: autodoc: can't detect overloaded methods defined in other file
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant