polyfills ¶
Functions:
-
disable_poly
–Internal function to disable builtin methods override.
-
enable_poly
–Internal function to enable builtin methods override.
PyTypeObject_as_types_dict module-attribute
¶
PyTypeObject_as_types_dict: dict[str, type[Structure]] = {
"tp_as_async": PyAsyncMethods,
"tp_as_number": PyNumberMethods,
"tp_as_sequence": PySequenceMethods,
"tp_as_mapping": PyMappingMethods,
}
SSizeObjArgProc_p module-attribute
¶
SSizeObjArgProc_p = CFUNCTYPE(c_int, PyObject_p, Py_ssize_t, PyObject_p)
TernaryFunc_p module-attribute
¶
TernaryFunc_p = CFUNCTYPE(py_object, PyObject_p, PyObject_p, PyObject_p)
as_number module-attribute
¶
as_number = (
"tp_as_number",
[
("add", "nb_add"),
("sub", "nb_subtract"),
("mul", "nb_multiply"),
("mod", "nb_remainder"),
("pow", "nb_power"),
("neg", "nb_negative"),
("pos", "nb_positive"),
("abs", "nb_absolute"),
("bool", "nb_bool"),
("inv", "nb_invert"),
("invert", "nb_invert"),
("lshift", "nb_lshift"),
("rshift", "nb_rshift"),
("and", "nb_and"),
("xor", "nb_xor"),
("or", "nb_or"),
("int", "nb_int"),
("float", "nb_float"),
("iadd", "nb_inplace_add"),
("isub", "nb_inplace_subtract"),
("imul", "nb_inplace_multiply"),
("imod", "nb_inplace_remainder"),
("ipow", "nb_inplace_power"),
("ilshift", "nb_inplace_lshift"),
("irshift", "nb_inplace_rshift"),
("iadd", "nb_inplace_and"),
("ixor", "nb_inplace_xor"),
("ior", "nb_inplace_or"),
("floordiv", "nb_floor_divide"),
("div", "nb_true_divide"),
("ifloordiv", "nb_inplace_floor_divide"),
("idiv", "nb_inplace_true_divide"),
("index", "nb_index"),
("matmul", "nb_matrix_multiply"),
("imatmul", "nb_inplace_matrix_multiply"),
],
)
builtin_methods module-attribute
¶
builtin_methods = {
(ob_type, dunder): (copy_func(getattr(ob_type, dunder)))
for dunder in dunder_methods
for ob_type in ob_types
if dunder in dir(ob_type)
}
dunder_methods module-attribute
¶
dunder_methods = [
"__add__",
"__iadd__",
"__sub__",
"__isub__",
"__mul__",
"__imul__",
"__floordiv__",
"__ifloordiv__",
"__pow__",
"__exp__",
"__log__",
"__sqrt__",
"__neg__",
"__pos__",
"__invert__",
"__int__",
"__float__",
"__abs__",
"__mod__",
"__and__",
"__or__",
"__xor__",
]
PyObject ¶
disable_poly ¶
disable_poly() -> None
Internal function to disable builtin methods override.
Source code
375 376 377 378 379 380 381 382 383 384 385 386 387 |
|
enable_poly ¶
enable_poly() -> None
Internal function to enable builtin methods override.
Source code
360 361 362 363 364 365 366 367 368 369 370 371 372 |
|
get_not_implemented ¶
get_not_implemented() -> Any
Source code
84 85 86 87 88 89 90 |
|