mirror of
https://github.com/johndoe6345789/typthon.git
synced 2026-05-02 01:25:56 +00:00
Fixed additional patterns: - _PyOpcode_* → _TyOpcode_* (all opcode metadata) - _PyUOpName → _TyUOpName - _PyFunction_* → _TyFunction_* - _PyListIterObject → _TyListIterObject - _Py_T_OBJECT → _Ty_T_OBJECT - Py_BEGIN_ALLOW_THREADS, Py_END_ALLOW_THREADS → Ty_* - PyDoc_STRVAR, PyDoc_STR → TyDoc_* - PyInterpreterState, PyThread_*, PyTime_t → Ty* - PyStructSequence_* → TyStructSequence_* - PyLockStatus → TyLockStatus - PyVarObject_HEAD_INIT → TyVarObject_HEAD_INIT - PyBaseExceptionObject → TyBaseExceptionObject - Fixed _PyExc_ → _TyExc_ in exception macros Build is progressing further. Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
116 lines
3.3 KiB
C
Generated
116 lines
3.3 KiB
C
Generated
/*[clinic input]
|
|
preserve
|
|
[clinic start generated code]*/
|
|
|
|
#include "pycore_modsupport.h" // _TyArg_CheckPositional()
|
|
|
|
TyDoc_STRVAR(_weakref_getweakrefcount__doc__,
|
|
"getweakrefcount($module, object, /)\n"
|
|
"--\n"
|
|
"\n"
|
|
"Return the number of weak references to \'object\'.");
|
|
|
|
#define _WEAKREF_GETWEAKREFCOUNT_METHODDEF \
|
|
{"getweakrefcount", (PyCFunction)_weakref_getweakrefcount, METH_O, _weakref_getweakrefcount__doc__},
|
|
|
|
static Ty_ssize_t
|
|
_weakref_getweakrefcount_impl(TyObject *module, TyObject *object);
|
|
|
|
static TyObject *
|
|
_weakref_getweakrefcount(TyObject *module, TyObject *object)
|
|
{
|
|
TyObject *return_value = NULL;
|
|
Ty_ssize_t _return_value;
|
|
|
|
_return_value = _weakref_getweakrefcount_impl(module, object);
|
|
if ((_return_value == -1) && TyErr_Occurred()) {
|
|
goto exit;
|
|
}
|
|
return_value = TyLong_FromSsize_t(_return_value);
|
|
|
|
exit:
|
|
return return_value;
|
|
}
|
|
|
|
TyDoc_STRVAR(_weakref__remove_dead_weakref__doc__,
|
|
"_remove_dead_weakref($module, dct, key, /)\n"
|
|
"--\n"
|
|
"\n"
|
|
"Atomically remove key from dict if it points to a dead weakref.");
|
|
|
|
#define _WEAKREF__REMOVE_DEAD_WEAKREF_METHODDEF \
|
|
{"_remove_dead_weakref", _PyCFunction_CAST(_weakref__remove_dead_weakref), METH_FASTCALL, _weakref__remove_dead_weakref__doc__},
|
|
|
|
static TyObject *
|
|
_weakref__remove_dead_weakref_impl(TyObject *module, TyObject *dct,
|
|
TyObject *key);
|
|
|
|
static TyObject *
|
|
_weakref__remove_dead_weakref(TyObject *module, TyObject *const *args, Ty_ssize_t nargs)
|
|
{
|
|
TyObject *return_value = NULL;
|
|
TyObject *dct;
|
|
TyObject *key;
|
|
|
|
if (!_TyArg_CheckPositional("_remove_dead_weakref", nargs, 2, 2)) {
|
|
goto exit;
|
|
}
|
|
if (!TyDict_Check(args[0])) {
|
|
_TyArg_BadArgument("_remove_dead_weakref", "argument 1", "dict", args[0]);
|
|
goto exit;
|
|
}
|
|
dct = args[0];
|
|
key = args[1];
|
|
return_value = _weakref__remove_dead_weakref_impl(module, dct, key);
|
|
|
|
exit:
|
|
return return_value;
|
|
}
|
|
|
|
TyDoc_STRVAR(_weakref_getweakrefs__doc__,
|
|
"getweakrefs($module, object, /)\n"
|
|
"--\n"
|
|
"\n"
|
|
"Return a list of all weak reference objects pointing to \'object\'.");
|
|
|
|
#define _WEAKREF_GETWEAKREFS_METHODDEF \
|
|
{"getweakrefs", (PyCFunction)_weakref_getweakrefs, METH_O, _weakref_getweakrefs__doc__},
|
|
|
|
TyDoc_STRVAR(_weakref_proxy__doc__,
|
|
"proxy($module, object, callback=None, /)\n"
|
|
"--\n"
|
|
"\n"
|
|
"Create a proxy object that weakly references \'object\'.\n"
|
|
"\n"
|
|
"\'callback\', if given, is called with a reference to the\n"
|
|
"proxy when \'object\' is about to be finalized.");
|
|
|
|
#define _WEAKREF_PROXY_METHODDEF \
|
|
{"proxy", _PyCFunction_CAST(_weakref_proxy), METH_FASTCALL, _weakref_proxy__doc__},
|
|
|
|
static TyObject *
|
|
_weakref_proxy_impl(TyObject *module, TyObject *object, TyObject *callback);
|
|
|
|
static TyObject *
|
|
_weakref_proxy(TyObject *module, TyObject *const *args, Ty_ssize_t nargs)
|
|
{
|
|
TyObject *return_value = NULL;
|
|
TyObject *object;
|
|
TyObject *callback = NULL;
|
|
|
|
if (!_TyArg_CheckPositional("proxy", nargs, 1, 2)) {
|
|
goto exit;
|
|
}
|
|
object = args[0];
|
|
if (nargs < 2) {
|
|
goto skip_optional;
|
|
}
|
|
callback = args[1];
|
|
skip_optional:
|
|
return_value = _weakref_proxy_impl(module, object, callback);
|
|
|
|
exit:
|
|
return return_value;
|
|
}
|
|
/*[clinic end generated code: output=60f59adc1dc9eab8 input=a9049054013a1b77]*/
|