8000 bpo-41287: Handle `doc` argument of `property.__init__` in subclasses by sizmailov · Pull Request #23205 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-41287: Handle doc argument of property.__init__ in subclasses #23205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
May 29, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Test vanila property too
  • Loading branch information
sizmailov committed May 22, 2022
commit 8730abc81abbae2023718a4a3a8af942e5416694
4 changes: 2 additions & 2 deletions Lib/test/test_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def getter(x):
def getter_wo_doc(x):
pass

for ps in PropertySub, PropertySubWoDoc:
for ps in property, PropertySub, PropertySubWoDoc:
doc = ps(getter, None, None, "issue 41287 is fixed").__doc__
self.assertEqual(doc, "issue 41287 is fixed",
"Getter overrides explicit property docstring (%s)" % ps.__name__)
Expand All @@ -270,7 +270,7 @@ def getter_wo_doc(x):
"Getter overrides explicit property docstring (%s)" % ps.__name__)

doc = ps(getter_wo_doc, None, None, None).__doc__
self.assertIsNone(doc)
self.assertIsNone(doc, "Property class doc appears in instance __doc__ (%s)" % ps.__name__)

@unittest.skipIf(sys.flags.optimize >= 2,
"Docstrings are omitted with -O2 and above")
Expand Down
0