8000 gh-98963: Restore the ability to have a dict-less property. by gpshead · Pull Request #105262 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-98963: Restore the ability to have a dict-less property. #105262

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 7 commits into from
Jun 5, 2023
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
Fix ASAN issue, to many DECREFs :P
  • Loading branch information
gpshead committed Jun 4, 2023
commit c6cdc7f87bf6258c36a0ff0c9f91a89a5d428da7
12 changes: 4 additions & 8 deletions Objects/descrobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1825,14 +1825,10 @@ property_init_impl(propertyobject *self, PyObject *fget, PyObject *fset,
// https://github.com/python/cpython/issues/98963#issuecomment-1574413319
// Python silently dropped this doc assignment through 3.11.
// We preserve that behavior for backwards compatibility.
if (prop_doc == Py_None) {
Py_DECREF(prop_doc);
return 0;
}
// If we ever want to deprecate this behavior, here is where to
// raise a DeprecationWarning; do not generate such noise when
// prop_doc is None.
Py_DECREF(prop_doc);
//
// If we ever want to deprecate this behavior, only raise a
// warning or error when proc_doc is not None so that
// property without a specific doc= still works.
return 0;
} else {
return -1;
Expand Down
0