-
-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Labels
unconfirmedThis bug was not reproduced yetThis bug was not reproduced yet
Description
This appears related to #116 (but is different as there is no concrete implementation here)
Description of the bug
When using stubs only, overloads do not get detected.
To Reproduce
# my_stub/__init__.py
from typing import overload
@overload
def foo(a: int) -> int: ...
@overload
def foo(a: str) -> str: ...
@overload
def bar(a: int) -> int: ...
@overload
def bar(a: str) -> str: ...
# This shoudn't be in the stub file, but without it Griffe does not detect the function.
def bar(a: int | str) -> int | str: ...
>>> griffe.load('my_stub').members
{'overload': Alias('overload', 'typing.overload'), 'bar': Function('bar', 18, 18)}
bar
is detected but not foo
in the stub.
Expected behavior
Expect foo
in the above stub to be detected.
Environment information
griffe==1.14.0
Note
Using a stub-only package for doc generation using mkdocstrings
to avoid pulling all dependencies of the full package.
Metadata
Metadata
Assignees
Labels
unconfirmedThis bug was not reproduced yetThis bug was not reproduced yet