diff --git a/test/testdata/misc.html b/test/testdata/misc.html index 1be4126e..f05739df 100644 --- a/test/testdata/misc.html +++ b/test/testdata/misc.html @@ -284,6 +284,15 @@

API Documentation

+
  • + DocstringFromNew + + +
  • @@ -739,47 +748,53 @@

    432 pass 433 434 -435__all__ = [ -436 "Issue226", -437 "var_with_default_obj", -438 "var_with_default_func", -439 "func_with_defaults", -440 "ClassmethodLink", -441 "GenericParent", -442 "NonGenericChild", -443 "Child", -444 "only_annotated", -445 "_Private", -446 "LambdaAttr", -447 "foo", -448 "bar", -449 "baz", -450 "qux", -451 "Indented", -452 "fun_with_protected_decorator", -453 "unhashable", -454 "AbstractClass", -455 "add_four", -456 "add_five", -457 "add_six", -458 "linkify_links", -459 "Issue352a", -460 "Issue352b", -461 "CustomCall", -462 "Headings", -463 "repr_not_syntax_highlightable", -464 "ClassDecorator", -465 "another_decorated_function", -466 "SubclassRef", -467 "ClassAsAttribute", -468 "scheduler", -469 "__init__", -470 "dynamically_modify_docstring1", -471 "dynamically_modify_docstring2", -472 "dynamically_modify_docstring3", -473 "dynamically_modify_docstring4", -474 "MyDict", -475] +435class DocstringFromNew: +436 def __new__(cls, *args, **kwargs): +437 """This is a class with a docstring inferred from `__new__`.""" +438 +439 +440__all__ = [ +441 "Issue226", +442 "var_with_default_obj", +443 "var_with_default_func", +444 "func_with_defaults", +445 "ClassmethodLink", +446 "GenericParent", +447 "NonGenericChild", +448 "Child", +449 "only_annotated", +450 "_Private", +451 "LambdaAttr", +452 "foo", +453 "bar", +454 "baz", +455 "qux", +456 "Indented", +457 "fun_with_protected_decorator", +458 "unhashable", +459 "AbstractClass", +460 "add_four", +461 "add_five", +462 "add_six", +463 "linkify_links", +464 "Issue352a", +465 "Issue352b", +466 "CustomCall", +467 "Headings", +468 "repr_not_syntax_highlightable", +469 "ClassDecorator", +470 "another_decorated_function", +471 "SubclassRef", +472 "ClassAsAttribute", +473 "scheduler", +474 "__init__", +475 "dynamically_modify_docstring1", +476 "dynamically_modify_docstring2", +477 "dynamically_modify_docstring3", +478 "dynamically_modify_docstring4", +479 "MyDict", +480 "DocstringFromNew", +481] @@ -2358,6 +2373,46 @@

    Inherited Members
    +
    + +
    + + class + DocstringFromNew: + + + +
    + +
    436class DocstringFromNew:
    +437    def __new__(cls, *args, **kwargs):
    +438        """This is a class with a docstring inferred from `__new__`."""
    +
    + + + + +
    + +
    + + DocstringFromNew(*args, **kwargs) + + + +
    + +
    437    def __new__(cls, *args, **kwargs):
    +438        """This is a class with a docstring inferred from `__new__`."""
    +
    + + +

    This is a class with a docstring inferred from __new__.

    +
    + + +
    +
    \ No newline at end of file diff --git a/test/testdata/misc.py b/test/testdata/misc.py index 73cb1213..b9c3ac66 100644 --- a/test/testdata/misc.py +++ b/test/testdata/misc.py @@ -432,6 +432,11 @@ class MyDict(dict): pass +class DocstringFromNew: + def __new__(cls, *args, **kwargs): + """This is a class with a docstring inferred from `__new__`.""" + + __all__ = [ "Issue226", "var_with_default_obj", @@ -472,4 +477,5 @@ class MyDict(dict): "dynamically_modify_docstring3", "dynamically_modify_docstring4", "MyDict", + "DocstringFromNew", ] diff --git a/test/testdata/misc.txt b/test/testdata/misc.txt index 02970b06..e66aaf97 100644 --- a/test/testdata/misc.txt +++ b/test/testdata/misc.txt @@ -132,4 +132,7 @@ None. …> a shallo…> > + + > > \ No newline at end of file diff --git a/test/testdata/type_stub.html b/test/testdata/type_stub.html index b86bf9d8..3e3cbaa7 100644 --- a/test/testdata/type_stub.html +++ b/test/testdata/type_stub.html @@ -50,6 +50,9 @@

    API Documentation

    +
  • + no_type_annotation +
  • @@ -102,6 +105,9 @@

    24 25 def meth(self, y): 26 """A simple method.""" +27 +28 def no_type_annotation(self, z): +29 """A method not present in the .pyi file.""" @@ -165,6 +171,9 @@

    25 26 def meth(self, y): 27 """A simple method.""" +28 +29 def no_type_annotation(self, z): +30 """A method not present in the .pyi file.""" @@ -204,6 +213,27 @@

    + +
    + +
    + + def + no_type_annotation(self, z): + + + +
    + +
    29    def no_type_annotation(self, z):
    +30        """A method not present in the .pyi file."""
    +
    + + +

    A method not present in the .pyi file.

    +
    + +
    diff --git a/test/testdata/type_stub.py b/test/testdata/type_stub.py index 63ef23fa..f668b3a7 100644 --- a/test/testdata/type_stub.py +++ b/test/testdata/type_stub.py @@ -24,3 +24,6 @@ class Subclass: def meth(self, y): """A simple method.""" + + def no_type_annotation(self, z): + """A method not present in the .pyi file.""" diff --git a/test/testdata/type_stub.txt b/test/testdata/type_stub.txt index 1a95b705..c98be431 100644 --- a/test/testdata/type_stub.txt +++ b/test/testdata/type_stub.txt @@ -10,5 +10,6 @@ bool: ... # A simple method.> > + > > \ No newline at end of file