summaryrefslogtreecommitdiffstats
path: root/tests/roots/test-ext-autodoc/target/typed_vars.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/roots/test-ext-autodoc/target/typed_vars.py')
-rw-r--r--tests/roots/test-ext-autodoc/target/typed_vars.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/roots/test-ext-autodoc/target/typed_vars.py b/tests/roots/test-ext-autodoc/target/typed_vars.py
new file mode 100644
index 0000000..0fe7468
--- /dev/null
+++ b/tests/roots/test-ext-autodoc/target/typed_vars.py
@@ -0,0 +1,34 @@
+#: attr1
+attr1: str = ''
+#: attr2
+attr2: str
+#: attr3
+attr3 = '' # type: str
+
+
+class _Descriptor:
+ def __init__(self, name):
+ self.__doc__ = f"This is {name}"
+ def __get__(self):
+ pass
+
+
+class Class:
+ attr1: int = 0
+ attr2: int
+ attr3 = 0 # type: int
+
+ descr4: int = _Descriptor("descr4")
+
+ def __init__(self):
+ self.attr4: int = 0 #: attr4
+ self.attr5: int #: attr5
+ self.attr6 = 0 # type: int
+ """attr6"""
+
+
+class Derived(Class):
+ attr7: int
+
+
+Alias = Derived