8000 gh-100942: Fix crash on `property` subtypes with weird `__new__` by sobolevn · Pull Request #100955 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-100942: Fix crash on property subtypes with weird __new__ #100955

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

Closed
wants to merge 3 commits into from

Conversation

sobolevn
Copy link
Member
@sobolevn sobolevn commented Jan 11, 2023

I went with the easiest solution: just raise a TypeError in this case.
What are other options? 🤔

@sobolevn
Copy link
Member Author

365556c is an alternative approach to 9bc9512

365556c does not raise, instead it uses this logic:

if (PyObject_TypeCheck(new, &PyProperty_Type)) {
        Py_XSETREF(((propertyobject *) new)->prop_name,
                   Py_XNewRef(pold->prop_name));
    }

@sobolevn sobolevn closed this Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0