summaryrefslogtreecommitdiffstats
path: root/tests/roots/test-ext-autodoc/target/descriptor.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/roots/test-ext-autodoc/target/descriptor.py')
-rw-r--r--tests/roots/test-ext-autodoc/target/descriptor.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/roots/test-ext-autodoc/target/descriptor.py b/tests/roots/test-ext-autodoc/target/descriptor.py
new file mode 100644
index 0000000..2857c99
--- /dev/null
+++ b/tests/roots/test-ext-autodoc/target/descriptor.py
@@ -0,0 +1,31 @@
+class CustomDataDescriptor:
+ """Descriptor class docstring."""
+
+ def __init__(self, doc):
+ self.__doc__ = doc
+
+ def __get__(self, obj, type=None):
+ if obj is None:
+ return self
+ return 42
+
+ def meth(self):
+ """Function."""
+ return "The Answer"
+
+
+class CustomDataDescriptorMeta(type):
+ """Descriptor metaclass docstring."""
+
+
+class CustomDataDescriptor2(CustomDataDescriptor):
+ """Descriptor class with custom metaclass docstring."""
+ __metaclass__ = CustomDataDescriptorMeta
+
+
+class Class:
+ descr = CustomDataDescriptor("Descriptor instance docstring.")
+
+ @property
+ def prop(self):
+ """Property."""