Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-89546: Clean up PyType_FromMetaclass#93686

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
miss-islington merged 19 commits intopython:mainfromencukou:PyType_From-cleanup
Jun 14, 2022
Merged
Changes from1 commit
Commits
Show all changes
19 commits
Select commitHold shift + click to select a range
d43d5ca
Raise invalid slot exceptions early
encukouMay 31, 2022
5145034
Switch to `switch` for the slots
encukouMay 31, 2022
87b28aa
Allocate & copy the docstring early
encukouJun 1, 2022
9fb6b11
Prepare the type names early
encukouJun 1, 2022
7fd0c6d
Move offset setting to before PyType_Ready
encukouJun 1, 2022
06fe302
Add comment on preparing special slots
encukouJun 1, 2022
8bb54f8
Comment that we don't want to call Python code while a type is half-b…
encukouJun 1, 2022
6c25cfc
Add comment on the function's refcounting strategy
encukouJun 1, 2022
7edb478
Check that base & offsets fit in the basicsize
encukouJun 1, 2022
2075958
Add blurb for the new check
encukouJun 10, 2022
763ea2d
Move variable declarations out of `switch` cases
encukouJun 10, 2022
5ca1502
Fix ReST syntax (*sigh*)
encukouJun 10, 2022
5b18552
Downcast to int to avoid a warning
encukouJun 13, 2022
34edc2a
Reflow check_basicsize_includes_size_and_offsets to conform to style …
encukouJun 13, 2022
e45f77f
Reword error messages to say "offset is out of bounds"
encukouJun 13, 2022
9713fb4
Move modname down to improve scoping
encukouJun 13, 2022
a997413
Move variables to smaller scopes
encukouJun 13, 2022
b197bb5
Merge main branch to resolve conflicts
encukouJun 13, 2022
f53d86c
One more PEP 7 nit!
encukouJun 14, 2022
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
PrevPrevious commit
NextNext commit
Add comment on the function's refcounting strategy
  • Loading branch information
@encukou
encukou committedJun 10, 2022
commit6c25cfcda973ed5cca2ed6c7daec34af3f5302db
5 changes: 5 additions & 0 deletionsObjects/typeobject.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3402,13 +3402,18 @@ PyObject *
PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module,
PyType_Spec *spec, PyObject *bases_in)
{
/* Invariant: A non-NULL value in one of these means this function holds
* a strong reference or owns allocated memory.
* These get decrefed/freed/returned at the end, on both success and error.
*/
PyHeapTypeObject *res = NULL;
PyObject *modname = NULL;
PyTypeObject *type;
PyObject *bases = NULL;
char *tp_doc = NULL;
PyObject *ht_name = NULL;
char *_ht_tpname = NULL;

int r;

/* Prepare slots that need special handling.
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp