Skip to content
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

Consistency #4

Open
encukou opened this issue Oct 9, 2023 · 1 comment
Open

Consistency #4

encukou opened this issue Oct 9, 2023 · 1 comment
Labels
guideline To be included in guidelines PEP

Comments

@encukou
Copy link
Contributor

encukou commented Oct 9, 2023

All new API should strictly follow guidelines that we figure out in this repo -- not returning borrowed references, consistent signaling of errors, etc.

Any exceptions should only be added as alternatives to the above, and should be clearly identifiable from their names.

This was referenced Oct 9, 2023
@gvanrossum
Copy link
Contributor

Any exceptions should only be added as alternatives to the above, and should be clearly identifiable from their names.

Unless the API function exists for the express purpose of transferring ownership. (Which should still be documented, of course, but there may not be a version of the API that does not steal the reference. Canonical example being DECREF.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guideline To be included in guidelines PEP
Projects
None yet
Development

No branches or pull requests

2 participants