-
-
Notifications
You must be signed in to change notification settings - Fork 144
Closed
Labels
bugSomething isn't workingSomething isn't workingupstreamIssue affects a dependency of oursIssue affects a dependency of ourswontfixThis will not be worked onThis will not be worked on
Description
Expected Behavior
- Generic classes, in usage and in definition, should include
TypeVar
parameters.
Actual Behavior
TypeVar
parameters are omitted from usage.TypeVar
parameters are shown on definition, but only as part of the constructor (though this is the most common case).typing.Generic
is listed as an ancestor twice.- The class is listed as a subclass of itself once per reference that completes the generic.
Steps to Reproduce
Sample code
from typing import Generic, TypeVar
T = TypeVar("T")
class Foo(Generic[T]):
"""A generic class."""
def __init__(self, x: T):
self.x = x
def a() -> Foo[int]:
return Foo(1)
def b() -> Foo[str]:
return Foo("b")
def c() -> Foo[bool]:
return Foo(True)
def d() -> Foo:
return Foo(None)
Build and output
$ pdoc3 --html --config show_type_annotations=True --config show_source_code=False test
Foo
is listed as a subclass three times, for each of a
, b
, c
(as d
doesn't define T
).
Additional info
- pdoc version: 0.7.1
kernckernc
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingupstreamIssue affects a dependency of oursIssue affects a dependency of ourswontfixThis will not be worked onThis will not be worked on