We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb9ea67 commit 7f87b70Copy full SHA for 7f87b70
1 file changed
tests/test_slots.py
@@ -752,6 +752,23 @@ def f(self):
752
assert A(11).f == 11
753
754
755
+def test_slots_cached_property_has_docstring():
756
+ """
757
+ cached_property in slotted class carries its original docstring
758
759
+
760
+ @attr.s(slots=True)
761
+ class A:
762
+ x = attr.ib()
763
764
+ @functools.cached_property
765
+ def f(self):
766
+ """What an informative docstring!"""
767
+ return self.x
768
769
+ assert A(11).f.__doc__ == "What an informative docstring!"
770
771
772
def test_slots_cached_property_class_does_not_have__dict__():
773
"""
774
slotted class with cached property has no __dict__ attribute.
0 commit comments