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

bpo-40137: Convert _functools module to use PyType_FromModuleAndSpec.#23405

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
Merged
Changes from1 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
PrevPrevious commit
apply petr's comment
  • Loading branch information
@shihai1991
shihai1991 committedDec 17, 2020
commit1941d8553619c786ce5d30fa54aaacc056067199
6 changes: 4 additions & 2 deletionsModules/_functoolsmodule.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,8 @@ get_functools_state(PyObject *module)

static void partial_setvectorcall(partialobject *pto);
static struct PyModuleDef _functools_module;
static PyObject *
partial_call(partialobject *pto, PyObject *args, PyObject *kwargs);

static inline _functools_state *
get_functools_state_by_type(PyTypeObject *type)
Expand All@@ -68,9 +70,9 @@ partial_new(PyTypeObject *type, PyObject *args, PyObject *kw)

pargs = pkw = NULL;
func = PyTuple_GET_ITEM(args, 0);
if (Py_TYPE(func)->tp_new ==partial_new) {
if (Py_TYPE(func)->tp_call ==(ternaryfunc)partial_call) {
// The type of "func" might not be exactly the same type object
// as "type", but if it is called usingpartial_new, it must have the
// as "type", but if it is called usingpartial_call, it must have the
// same memory layout (fn, args and kw members).
// We can use its underlying function directly and merge the arguments.
partialobject *part = (partialobject *)func;
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp