diff -r bbe6b215df5d Lib/test/test_property.py --- a/Lib/test/test_property.py Fri Aug 14 11:06:43 2015 -0700 +++ b/Lib/test/test_property.py Fri Aug 14 15:24:44 2015 -0400 @@ -207,6 +207,19 @@ Foo.spam.__doc__, "spam wrapped in property subclass") + def test_docstring_via_new(self): + """Regression test for issue24766""" + + class Foo(object): + def _get_spam(self): + return 1 + + spam = PropertySub(_get_spam, doc="spam as property subclass") + + self.assertEqual( + Foo.spam.__doc__, + "spam as property subclass") + @unittest.skipIf(sys.flags.optimize >= 2, "Docstrings are omitted with -O2 and above") def test_property_setter_copies_getter_docstring(self):