mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
GH-137623: Use an AC decorator for docstring line length enforcement (#137690)
This commit is contained in:
parent
0324c726de
commit
918e3ba6c0
76 changed files with 569 additions and 570 deletions
|
|
@ -4080,13 +4080,14 @@ test_preprocessor_guarded_if_with_continuation_impl(PyObject *module)
|
|||
#if CONDITION_E || CONDITION_F
|
||||
#warning "different type of CPP directive"
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
test_preprocessor_guarded_if_e_or_f
|
||||
Makes sure cpp.Monitor handles other directives than preprocessor conditionals.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
test_preprocessor_guarded_if_e_or_f_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=e49d24ff64ad88bc input=57b9c37f938bc4f1]*/
|
||||
/*[clinic end generated code: output=e49d24ff64ad88bc input=3ca9ab4e883300ed]*/
|
||||
#endif
|
||||
|
||||
/*[clinic input]
|
||||
|
|
|
|||
|
|
@ -484,6 +484,7 @@ error:
|
|||
#define COLLECTION_FLAGS (Py_TPFLAGS_SEQUENCE | Py_TPFLAGS_MAPPING)
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_abc._abc_init
|
||||
|
||||
self: object
|
||||
|
|
@ -494,7 +495,7 @@ Internal ABC helper for class set-up. Should be never used outside abc module.
|
|||
|
||||
static PyObject *
|
||||
_abc__abc_init(PyObject *module, PyObject *self)
|
||||
/*[clinic end generated code: output=594757375714cda1 input=8d7fe470ff77f029]*/
|
||||
/*[clinic end generated code: output=594757375714cda1 input=0b3513f947736d39]*/
|
||||
{
|
||||
_abcmodule_state *state = get_abc_state(module);
|
||||
PyObject *data;
|
||||
|
|
@ -543,6 +544,7 @@ _abc__abc_init(PyObject *module, PyObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_abc._abc_register
|
||||
|
||||
self: object
|
||||
|
|
@ -554,7 +556,7 @@ Internal ABC helper for subclasss registration. Should be never used outside abc
|
|||
|
||||
static PyObject *
|
||||
_abc__abc_register_impl(PyObject *module, PyObject *self, PyObject *subclass)
|
||||
/*[clinic end generated code: output=7851e7668c963524 input=ca589f8c3080e67f]*/
|
||||
/*[clinic end generated code: output=7851e7668c963524 input=135ab13a581b4414]*/
|
||||
{
|
||||
if (!PyType_Check(subclass)) {
|
||||
PyErr_SetString(PyExc_TypeError, "Can only register classes");
|
||||
|
|
@ -606,6 +608,7 @@ _abc__abc_register_impl(PyObject *module, PyObject *self, PyObject *subclass)
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_abc._abc_instancecheck
|
||||
|
||||
self: object
|
||||
|
|
@ -618,7 +621,7 @@ Internal ABC helper for instance checks. Should be never used outside abc module
|
|||
static PyObject *
|
||||
_abc__abc_instancecheck_impl(PyObject *module, PyObject *self,
|
||||
PyObject *instance)
|
||||
/*[clinic end generated code: output=b8b5148f63b6b56f input=a4f4525679261084]*/
|
||||
/*[clinic end generated code: output=b8b5148f63b6b56f input=0bbc8da0ea346719]*/
|
||||
{
|
||||
PyObject *subtype, *result = NULL, *subclass = NULL;
|
||||
_abc_data *impl = _get_impl(module, self);
|
||||
|
|
@ -692,6 +695,7 @@ static int subclasscheck_check_registry(_abc_data *impl, PyObject *subclass,
|
|||
PyObject **result);
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_abc._abc_subclasscheck
|
||||
|
||||
self: object
|
||||
|
|
@ -704,7 +708,7 @@ Internal ABC helper for subclasss checks. Should be never used outside abc modul
|
|||
static PyObject *
|
||||
_abc__abc_subclasscheck_impl(PyObject *module, PyObject *self,
|
||||
PyObject *subclass)
|
||||
/*[clinic end generated code: output=b56c9e4a530e3894 input=1d947243409d10b8]*/
|
||||
/*[clinic end generated code: output=b56c9e4a530e3894 input=5bf1ef712f5d3610]*/
|
||||
{
|
||||
if (!PyType_Check(subclass)) {
|
||||
PyErr_SetString(PyExc_TypeError, "issubclass() arg 1 must be a class");
|
||||
|
|
|
|||
|
|
@ -598,6 +598,7 @@ error:
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_bz2.BZ2Decompressor.decompress
|
||||
|
||||
data: Py_buffer
|
||||
|
|
@ -622,7 +623,7 @@ the unused_data attribute.
|
|||
static PyObject *
|
||||
_bz2_BZ2Decompressor_decompress_impl(BZ2Decompressor *self, Py_buffer *data,
|
||||
Py_ssize_t max_length)
|
||||
/*[clinic end generated code: output=23e41045deb240a3 input=52e1ffc66a8ea624]*/
|
||||
/*[clinic end generated code: output=23e41045deb240a3 input=3703e78f91757655]*/
|
||||
{
|
||||
PyObject *result = NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ _codecs_unregister(PyObject *module, PyObject *search_function)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_codecs.lookup
|
||||
encoding: str
|
||||
/
|
||||
|
|
@ -101,7 +102,7 @@ Looks up a codec tuple in the Python codec registry and returns a CodecInfo obje
|
|||
|
||||
static PyObject *
|
||||
_codecs_lookup_impl(PyObject *module, const char *encoding)
|
||||
/*[clinic end generated code: output=9f0afa572080c36d input=3c572c0db3febe9c]*/
|
||||
/*[clinic end generated code: output=9f0afa572080c36d input=02227d5429491ab3]*/
|
||||
{
|
||||
return _PyCodec_Lookup(encoding);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1787,6 +1787,7 @@ align_func(PyObject *self, PyObject *obj)
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@critical_section obj
|
||||
_ctypes.byref
|
||||
obj: object(subclass_of="clinic_state()->PyCData_Type")
|
||||
|
|
@ -1798,7 +1799,7 @@ Return a pointer lookalike to a C instance, only usable as function argument.
|
|||
|
||||
static PyObject *
|
||||
_ctypes_byref_impl(PyObject *module, PyObject *obj, Py_ssize_t offset)
|
||||
/*[clinic end generated code: output=60dec5ed520c71de input=6ec02d95d15fbd56]*/
|
||||
/*[clinic end generated code: output=60dec5ed520c71de input=870076149a2de427]*/
|
||||
{
|
||||
ctypes_state *st = get_module_state(module);
|
||||
|
||||
|
|
|
|||
|
|
@ -360,6 +360,7 @@ _curses_panel_panel_bottom_impl(PyCursesPanelObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses_panel.panel.hide
|
||||
|
||||
Hide the panel.
|
||||
|
|
@ -369,7 +370,7 @@ This does not delete the object, it just makes the window on screen invisible.
|
|||
|
||||
static PyObject *
|
||||
_curses_panel_panel_hide_impl(PyCursesPanelObject *self)
|
||||
/*[clinic end generated code: output=a7bbbd523e1eab49 input=f6ab884e99386118]*/
|
||||
/*[clinic end generated code: output=a7bbbd523e1eab49 input=9071b463a39a1a6a]*/
|
||||
{
|
||||
int rtn = hide_panel(self->pan);
|
||||
return curses_panel_panel_check_err(self, rtn, "hide_panel", "hide");
|
||||
|
|
|
|||
|
|
@ -1353,6 +1353,7 @@ _curses_window_bkgdset_impl(PyCursesWindowObject *self, PyObject *ch,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.window.border
|
||||
|
||||
ls: object(c_default="NULL") = _curses.ACS_VLINE
|
||||
|
|
@ -1386,7 +1387,7 @@ _curses_window_border_impl(PyCursesWindowObject *self, PyObject *ls,
|
|||
PyObject *rs, PyObject *ts, PyObject *bs,
|
||||
PyObject *tl, PyObject *tr, PyObject *bl,
|
||||
PyObject *br)
|
||||
/*[clinic end generated code: output=670ef38d3d7c2aa3 input=e015f735d67a240b]*/
|
||||
/*[clinic end generated code: output=670ef38d3d7c2aa3 input=adaafca87488ee35]*/
|
||||
{
|
||||
chtype ch[8];
|
||||
int i, rtn;
|
||||
|
|
@ -1589,6 +1590,7 @@ _curses_window_delch_impl(PyCursesWindowObject *self, int group_right_1,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.window.derwin
|
||||
|
||||
[
|
||||
|
|
@ -1613,7 +1615,7 @@ screen.
|
|||
static PyObject *
|
||||
_curses_window_derwin_impl(PyCursesWindowObject *self, int group_left_1,
|
||||
int nlines, int ncols, int begin_y, int begin_x)
|
||||
/*[clinic end generated code: output=7924b112d9f70d6e input=966d9481f7f5022e]*/
|
||||
/*[clinic end generated code: output=7924b112d9f70d6e input=ebe95ded1c284c8e]*/
|
||||
{
|
||||
WINDOW *win;
|
||||
|
||||
|
|
@ -1669,6 +1671,7 @@ _curses_window_echochar_impl(PyCursesWindowObject *self, PyObject *ch,
|
|||
|
||||
#ifdef NCURSES_MOUSE_VERSION
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_curses.window.enclose
|
||||
|
||||
y: int
|
||||
|
|
@ -1682,7 +1685,7 @@ Return True if the screen-relative coordinates are enclosed by the window.
|
|||
|
||||
static PyObject *
|
||||
_curses_window_enclose_impl(PyCursesWindowObject *self, int y, int x)
|
||||
/*[clinic end generated code: output=8679beef50502648 input=4fd3355d723f7bc9]*/
|
||||
/*[clinic end generated code: output=8679beef50502648 input=9ba7c894cffe5507]*/
|
||||
{
|
||||
return PyBool_FromLong(wenclose(self->win, y, x));
|
||||
}
|
||||
|
|
@ -1722,6 +1725,7 @@ curses_check_signals_on_input_error(PyCursesWindowObject *self,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.window.getch
|
||||
|
||||
[
|
||||
|
|
@ -1742,7 +1746,7 @@ is returned if there is no input, else getch() waits until a key is pressed.
|
|||
static PyObject *
|
||||
_curses_window_getch_impl(PyCursesWindowObject *self, int group_right_1,
|
||||
int y, int x)
|
||||
/*[clinic end generated code: output=e1639e87d545e676 input=73f350336b1ee8c8]*/
|
||||
/*[clinic end generated code: output=e1639e87d545e676 input=9a053077373e2a30]*/
|
||||
{
|
||||
int rtn;
|
||||
|
||||
|
|
@ -1769,6 +1773,7 @@ _curses_window_getch_impl(PyCursesWindowObject *self, int group_right_1,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.window.getkey
|
||||
|
||||
[
|
||||
|
|
@ -1789,7 +1794,7 @@ key name. In no-delay mode, an exception is raised if there is no input.
|
|||
static PyObject *
|
||||
_curses_window_getkey_impl(PyCursesWindowObject *self, int group_right_1,
|
||||
int y, int x)
|
||||
/*[clinic end generated code: output=8490a182db46b10f input=be2dee34f5cf57f8]*/
|
||||
/*[clinic end generated code: output=8490a182db46b10f input=5177f03fb6c31ea6]*/
|
||||
{
|
||||
int rtn;
|
||||
|
||||
|
|
@ -2012,6 +2017,7 @@ _curses_window_hline_impl(PyCursesWindowObject *self, int group_left_1,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.window.insch
|
||||
|
||||
[
|
||||
|
|
@ -2040,7 +2046,7 @@ static PyObject *
|
|||
_curses_window_insch_impl(PyCursesWindowObject *self, int group_left_1,
|
||||
int y, int x, PyObject *ch, int group_right_1,
|
||||
long attr)
|
||||
/*[clinic end generated code: output=ade8cfe3a3bf3e34 input=336342756ee19812]*/
|
||||
/*[clinic end generated code: output=ade8cfe3a3bf3e34 input=3f2a230cb09fed5a]*/
|
||||
{
|
||||
int rtn;
|
||||
chtype ch_ = 0;
|
||||
|
|
@ -2062,6 +2068,7 @@ _curses_window_insch_impl(PyCursesWindowObject *self, int group_left_1,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.window.inch
|
||||
|
||||
[
|
||||
|
|
@ -2080,7 +2087,7 @@ The bottom 8 bits are the character proper, and upper bits are the attributes.
|
|||
static PyObject *
|
||||
_curses_window_inch_impl(PyCursesWindowObject *self, int group_right_1,
|
||||
int y, int x)
|
||||
/*[clinic end generated code: output=97ca8581baaafd06 input=4b4fb43d85b177c3]*/
|
||||
/*[clinic end generated code: output=97ca8581baaafd06 input=a5846f315464dc86]*/
|
||||
{
|
||||
chtype rtn;
|
||||
const char *funcname;
|
||||
|
|
@ -2250,6 +2257,7 @@ _curses_window_insstr_impl(PyCursesWindowObject *self, int group_left_1,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.window.insnstr
|
||||
|
||||
[
|
||||
|
|
@ -2285,7 +2293,7 @@ static PyObject *
|
|||
_curses_window_insnstr_impl(PyCursesWindowObject *self, int group_left_1,
|
||||
int y, int x, PyObject *str, int n,
|
||||
int group_right_1, long attr)
|
||||
/*[clinic end generated code: output=971a32ea6328ec8b input=70fa0cd543901a4c]*/
|
||||
/*[clinic end generated code: output=971a32ea6328ec8b input=dcdc554102fbcd5d]*/
|
||||
{
|
||||
int rtn;
|
||||
int strtype;
|
||||
|
|
@ -2350,6 +2358,7 @@ _curses_window_insnstr_impl(PyCursesWindowObject *self, int group_left_1,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.window.is_linetouched
|
||||
|
||||
line: int
|
||||
|
|
@ -2363,7 +2372,7 @@ Raise a curses.error exception if line is not valid for the given window.
|
|||
|
||||
static PyObject *
|
||||
_curses_window_is_linetouched_impl(PyCursesWindowObject *self, int line)
|
||||
/*[clinic end generated code: output=ad4a4edfee2db08c input=a7be0c189f243914]*/
|
||||
/*[clinic end generated code: output=ad4a4edfee2db08c input=af71c040b951c467]*/
|
||||
{
|
||||
int erg;
|
||||
erg = is_linetouched(self->win, line);
|
||||
|
|
@ -2376,6 +2385,7 @@ _curses_window_is_linetouched_impl(PyCursesWindowObject *self, int line)
|
|||
|
||||
#ifdef py_is_pad
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.window.noutrefresh
|
||||
|
||||
[
|
||||
|
|
@ -2400,9 +2410,10 @@ _curses_window_noutrefresh_impl(PyCursesWindowObject *self,
|
|||
int group_right_1, int pminrow, int pmincol,
|
||||
int sminrow, int smincol, int smaxrow,
|
||||
int smaxcol)
|
||||
/*[clinic end generated code: output=809a1f3c6a03e23e input=3e56898388cd739e]*/
|
||||
/*[clinic end generated code: output=809a1f3c6a03e23e input=b39fe8fc79b9980b]*/
|
||||
#else
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.window.noutrefresh
|
||||
|
||||
Mark for refresh but wait.
|
||||
|
|
@ -2414,7 +2425,7 @@ that, call doupdate().
|
|||
|
||||
static PyObject *
|
||||
_curses_window_noutrefresh_impl(PyCursesWindowObject *self)
|
||||
/*[clinic end generated code: output=6ef6dec666643fee input=876902e3fa431dbd]*/
|
||||
/*[clinic end generated code: output=6ef6dec666643fee input=6a9f59ae5e4c139e]*/
|
||||
#endif
|
||||
{
|
||||
int rtn;
|
||||
|
|
@ -2447,6 +2458,7 @@ _curses_window_noutrefresh_impl(PyCursesWindowObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.window.overlay
|
||||
|
||||
destwin: object(type="PyCursesWindowObject *", subclass_of="clinic_state()->window_type")
|
||||
|
|
@ -2478,7 +2490,7 @@ _curses_window_overlay_impl(PyCursesWindowObject *self,
|
|||
PyCursesWindowObject *destwin, int group_right_1,
|
||||
int sminrow, int smincol, int dminrow,
|
||||
int dmincol, int dmaxrow, int dmaxcol)
|
||||
/*[clinic end generated code: output=82bb2c4cb443ca58 input=6e4b32a7c627a356]*/
|
||||
/*[clinic end generated code: output=82bb2c4cb443ca58 input=dd6af34deb892a65]*/
|
||||
{
|
||||
int rtn;
|
||||
|
||||
|
|
@ -2494,6 +2506,7 @@ _curses_window_overlay_impl(PyCursesWindowObject *self,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.window.overwrite
|
||||
|
||||
destwin: object(type="PyCursesWindowObject *", subclass_of="clinic_state()->window_type")
|
||||
|
|
@ -2526,7 +2539,7 @@ _curses_window_overwrite_impl(PyCursesWindowObject *self,
|
|||
int group_right_1, int sminrow, int smincol,
|
||||
int dminrow, int dmincol, int dmaxrow,
|
||||
int dmaxcol)
|
||||
/*[clinic end generated code: output=12ae007d1681be28 input=d83dd8b24ff2bcc9]*/
|
||||
/*[clinic end generated code: output=12ae007d1681be28 input=e84d8ebdf1c09596]*/
|
||||
{
|
||||
int rtn;
|
||||
|
||||
|
|
@ -2610,6 +2623,7 @@ _curses_window_redrawln_impl(PyCursesWindowObject *self, int beg, int num)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.window.refresh
|
||||
|
||||
[
|
||||
|
|
@ -2641,7 +2655,7 @@ static PyObject *
|
|||
_curses_window_refresh_impl(PyCursesWindowObject *self, int group_right_1,
|
||||
int pminrow, int pmincol, int sminrow,
|
||||
int smincol, int smaxrow, int smaxcol)
|
||||
/*[clinic end generated code: output=42199543115e6e63 input=95e01cb5ffc635d0]*/
|
||||
/*[clinic end generated code: output=42199543115e6e63 input=65405c03290496a6]*/
|
||||
{
|
||||
int rtn;
|
||||
|
||||
|
|
@ -2694,6 +2708,7 @@ _curses_window_setscrreg_impl(PyCursesWindowObject *self, int top,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.window.subwin
|
||||
|
||||
[
|
||||
|
|
@ -2717,7 +2732,7 @@ lower right corner of the window.
|
|||
static PyObject *
|
||||
_curses_window_subwin_impl(PyCursesWindowObject *self, int group_left_1,
|
||||
int nlines, int ncols, int begin_y, int begin_x)
|
||||
/*[clinic end generated code: output=93e898afc348f59a input=2129fa47fd57721c]*/
|
||||
/*[clinic end generated code: output=93e898afc348f59a input=5292cf610e2f3585]*/
|
||||
{
|
||||
WINDOW *win;
|
||||
const char *funcname;
|
||||
|
|
@ -2745,6 +2760,7 @@ _curses_window_subwin_impl(PyCursesWindowObject *self, int group_left_1,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.window.scroll
|
||||
|
||||
[
|
||||
|
|
@ -2761,7 +2777,7 @@ Scroll upward if the argument is positive and downward if it is negative.
|
|||
static PyObject *
|
||||
_curses_window_scroll_impl(PyCursesWindowObject *self, int group_right_1,
|
||||
int lines)
|
||||
/*[clinic end generated code: output=4541a8a11852d360 input=c969ca0cfabbdbec]*/
|
||||
/*[clinic end generated code: output=4541a8a11852d360 input=386456524c550113]*/
|
||||
{
|
||||
int rtn;
|
||||
const char *funcname;
|
||||
|
|
@ -2777,6 +2793,7 @@ _curses_window_scroll_impl(PyCursesWindowObject *self, int group_right_1,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.window.touchline
|
||||
|
||||
start: int
|
||||
|
|
@ -2795,7 +2812,7 @@ as having been changed (changed=True) or unchanged (changed=False).
|
|||
static PyObject *
|
||||
_curses_window_touchline_impl(PyCursesWindowObject *self, int start,
|
||||
int count, int group_right_1, int changed)
|
||||
/*[clinic end generated code: output=65d05b3f7438c61d input=a98aa4f79b6be845]*/
|
||||
/*[clinic end generated code: output=65d05b3f7438c61d input=36e13b6f5eb591f5]*/
|
||||
{
|
||||
int rtn;
|
||||
const char *funcname;
|
||||
|
|
@ -3142,6 +3159,7 @@ _curses_beep_impl(PyObject *module)
|
|||
NoArgNoReturnFunctionBody(beep)
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_curses.can_change_color
|
||||
|
||||
Return True if the programmer can change the colors displayed by the terminal.
|
||||
|
|
@ -3149,7 +3167,7 @@ Return True if the programmer can change the colors displayed by the terminal.
|
|||
|
||||
static PyObject *
|
||||
_curses_can_change_color_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=359df8c3c77d8bf1 input=d7718884de0092f2]*/
|
||||
/*[clinic end generated code: output=359df8c3c77d8bf1 input=8315c364ba1e5b4c]*/
|
||||
NoArgTrueFalseFunctionBody(can_change_color)
|
||||
|
||||
/*[clinic input]
|
||||
|
|
@ -3174,6 +3192,7 @@ _curses_cbreak_impl(PyObject *module, int flag)
|
|||
NoArgOrFlagNoReturnFunctionBody(cbreak, flag)
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.color_content
|
||||
|
||||
color_number: color
|
||||
|
|
@ -3188,7 +3207,7 @@ which will be between 0 (no component) and 1000 (maximum amount of component).
|
|||
|
||||
static PyObject *
|
||||
_curses_color_content_impl(PyObject *module, int color_number)
|
||||
/*[clinic end generated code: output=17b466df7054e0de input=03b5ed0472662aea]*/
|
||||
/*[clinic end generated code: output=17b466df7054e0de input=baffe25b351eb916]*/
|
||||
{
|
||||
_CURSES_COLOR_VAL_TYPE r,g,b;
|
||||
|
||||
|
|
@ -3367,6 +3386,7 @@ _curses_erasechar_impl(PyObject *module)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.flash
|
||||
|
||||
Flash the screen.
|
||||
|
|
@ -3376,7 +3396,7 @@ That is, change it to reverse-video and then change it back in a short interval.
|
|||
|
||||
static PyObject *
|
||||
_curses_flash_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=488b8a0ebd9ea9b8 input=02fdfb06c8fc3171]*/
|
||||
/*[clinic end generated code: output=488b8a0ebd9ea9b8 input=dd33d718e6edf436]*/
|
||||
NoArgNoReturnFunctionBody(flash)
|
||||
|
||||
/*[clinic input]
|
||||
|
|
@ -3997,6 +4017,7 @@ NoArgTrueFalseFunctionBody(isendwin)
|
|||
|
||||
#ifdef HAVE_CURSES_IS_TERM_RESIZED
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_curses.is_term_resized
|
||||
|
||||
nlines: int
|
||||
|
|
@ -4010,7 +4031,7 @@ Return True if resize_term() would modify the window structure, False otherwise.
|
|||
|
||||
static PyObject *
|
||||
_curses_is_term_resized_impl(PyObject *module, int nlines, int ncols)
|
||||
/*[clinic end generated code: output=aafe04afe50f1288 input=ca9c0bd0fb8ab444]*/
|
||||
/*[clinic end generated code: output=aafe04afe50f1288 input=5792a3f40cecb010]*/
|
||||
{
|
||||
PyCursesStatefulInitialised(module);
|
||||
|
||||
|
|
@ -4063,6 +4084,7 @@ _curses_killchar_impl(PyObject *module)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.longname
|
||||
|
||||
Return the terminfo long name field describing the current terminal.
|
||||
|
|
@ -4073,7 +4095,7 @@ only after the call to initscr().
|
|||
|
||||
static PyObject *
|
||||
_curses_longname_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=fdf30433727ef568 input=84c3f20201b1098e]*/
|
||||
/*[clinic end generated code: output=fdf30433727ef568 input=5de06852f2230ddb]*/
|
||||
NoArgReturnStringFunctionBody(longname)
|
||||
|
||||
/*[clinic input]
|
||||
|
|
@ -4126,6 +4148,7 @@ _curses_mouseinterval_impl(PyObject *module, int interval)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_curses.mousemask
|
||||
|
||||
newmask: unsigned_long(bitwise=True)
|
||||
|
|
@ -4141,7 +4164,7 @@ If this function is never called, no mouse events are ever reported.
|
|||
|
||||
static PyObject *
|
||||
_curses_mousemask_impl(PyObject *module, unsigned long newmask)
|
||||
/*[clinic end generated code: output=9406cf1b8a36e485 input=bdf76b7568a3c541]*/
|
||||
/*[clinic end generated code: output=9406cf1b8a36e485 input=b92ff4fbe5ce61b1]*/
|
||||
{
|
||||
mmask_t oldmask, availmask;
|
||||
|
||||
|
|
@ -4523,6 +4546,7 @@ _curses_raw_impl(PyObject *module, int flag)
|
|||
NoArgOrFlagNoReturnFunctionBody(raw, flag)
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_curses.reset_prog_mode
|
||||
|
||||
Restore the terminal to "program" mode, as previously saved by def_prog_mode().
|
||||
|
|
@ -4530,10 +4554,11 @@ Restore the terminal to "program" mode, as previously saved by def_prog_mode().
|
|||
|
||||
static PyObject *
|
||||
_curses_reset_prog_mode_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=15eb765abf0b6575 input=3d82bea2b3243471]*/
|
||||
/*[clinic end generated code: output=15eb765abf0b6575 input=a8b44b5261c8cf3a]*/
|
||||
NoArgNoReturnFunctionBody(reset_prog_mode)
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_curses.reset_shell_mode
|
||||
|
||||
Restore the terminal to "shell" mode, as previously saved by def_shell_mode().
|
||||
|
|
@ -4541,7 +4566,7 @@ Restore the terminal to "shell" mode, as previously saved by def_shell_mode().
|
|||
|
||||
static PyObject *
|
||||
_curses_reset_shell_mode_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=0238de2962090d33 input=1c738fa64bd1a24f]*/
|
||||
/*[clinic end generated code: output=0238de2962090d33 input=f5224034a2c95931]*/
|
||||
NoArgNoReturnFunctionBody(reset_shell_mode)
|
||||
|
||||
/*[clinic input]
|
||||
|
|
@ -4595,6 +4620,7 @@ _curses_resizeterm_impl(PyObject *module, short nlines, short ncols)
|
|||
|
||||
#ifdef HAVE_CURSES_RESIZE_TERM
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.resize_term
|
||||
|
||||
nlines: short
|
||||
|
|
@ -4614,7 +4640,7 @@ without additional interaction with the application.
|
|||
|
||||
static PyObject *
|
||||
_curses_resize_term_impl(PyObject *module, short nlines, short ncols)
|
||||
/*[clinic end generated code: output=46c6d749fa291dbd input=276afa43d8ea7091]*/
|
||||
/*[clinic end generated code: output=46c6d749fa291dbd input=ebfa840f6b5f03fa]*/
|
||||
{
|
||||
PyObject *result;
|
||||
int code;
|
||||
|
|
@ -4733,6 +4759,7 @@ _curses_termattrs_impl(PyObject *module)
|
|||
NoArgReturnIntFunctionBody(termattrs)
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_curses.termname
|
||||
|
||||
Return the value of the environment variable TERM, truncated to 14 characters.
|
||||
|
|
@ -4740,7 +4767,7 @@ Return the value of the environment variable TERM, truncated to 14 characters.
|
|||
|
||||
static PyObject *
|
||||
_curses_termname_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=96375577ebbd67fd input=33c08d000944f33f]*/
|
||||
/*[clinic end generated code: output=96375577ebbd67fd input=c34f724d8ce8fc4e]*/
|
||||
NoArgReturnStringFunctionBody(termname)
|
||||
|
||||
/*[clinic input]
|
||||
|
|
@ -5000,6 +5027,7 @@ _curses_unget_wch(PyObject *module, PyObject *ch)
|
|||
|
||||
#ifdef HAVE_CURSES_USE_ENV
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_curses.use_env
|
||||
|
||||
flag: bool
|
||||
|
|
@ -5019,7 +5047,7 @@ not set).
|
|||
|
||||
static PyObject *
|
||||
_curses_use_env_impl(PyObject *module, int flag)
|
||||
/*[clinic end generated code: output=b2c445e435c0b164 input=06ac30948f2d78e4]*/
|
||||
/*[clinic end generated code: output=b2c445e435c0b164 input=eaa9047ec73c27d3]*/
|
||||
{
|
||||
use_env(flag);
|
||||
Py_RETURN_NONE;
|
||||
|
|
|
|||
|
|
@ -3293,6 +3293,7 @@ datetime_date_today_impl(PyTypeObject *type)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
@classmethod
|
||||
datetime.date.fromtimestamp
|
||||
|
||||
|
|
@ -3307,7 +3308,7 @@ as local time.
|
|||
|
||||
static PyObject *
|
||||
datetime_date_fromtimestamp_impl(PyTypeObject *type, PyObject *timestamp)
|
||||
/*[clinic end generated code: output=59def4e32c028fb6 input=eabb3fe7f40491fe]*/
|
||||
/*[clinic end generated code: output=59def4e32c028fb6 input=55ff6940f0a8339f]*/
|
||||
{
|
||||
return date_fromtimestamp(type, timestamp);
|
||||
}
|
||||
|
|
@ -4866,6 +4867,7 @@ datetime_time_isoformat_impl(PyDateTime_Time *self, const char *timespec)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
datetime.time.strftime
|
||||
|
||||
format: unicode
|
||||
|
|
@ -4877,7 +4879,7 @@ The date part of the timestamp passed to underlying strftime should not be used.
|
|||
|
||||
static PyObject *
|
||||
datetime_time_strftime_impl(PyDateTime_Time *self, PyObject *format)
|
||||
/*[clinic end generated code: output=10f65af20e2a78c7 input=7dd9df1acbf37b50]*/
|
||||
/*[clinic end generated code: output=10f65af20e2a78c7 input=541934a2860f7db5]*/
|
||||
{
|
||||
PyObject *result;
|
||||
PyObject *tuple;
|
||||
|
|
@ -5682,6 +5684,7 @@ datetime_datetime_utcnow_impl(PyTypeObject *type)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
@classmethod
|
||||
datetime.datetime.fromtimestamp
|
||||
|
||||
|
|
@ -5697,7 +5700,7 @@ as local time.
|
|||
static PyObject *
|
||||
datetime_datetime_fromtimestamp_impl(PyTypeObject *type, PyObject *timestamp,
|
||||
PyObject *tzinfo)
|
||||
/*[clinic end generated code: output=9c47ea2b2ebdaded input=34721a5facc94215]*/
|
||||
/*[clinic end generated code: output=9c47ea2b2ebdaded input=d6b5b2095c5a34b2]*/
|
||||
{
|
||||
PyObject *self;
|
||||
if (check_tzinfo_subclass(tzinfo) < 0)
|
||||
|
|
@ -5759,6 +5762,7 @@ datetime_datetime_utcfromtimestamp_impl(PyTypeObject *type,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@classmethod
|
||||
datetime.datetime.strptime
|
||||
|
||||
|
|
@ -5772,7 +5776,7 @@ Parse string according to the given date and time format (like time.strptime()).
|
|||
static PyObject *
|
||||
datetime_datetime_strptime_impl(PyTypeObject *type, PyObject *string,
|
||||
PyObject *format)
|
||||
/*[clinic end generated code: output=af2c2d024f3203f5 input=b3918835524a1f22]*/
|
||||
/*[clinic end generated code: output=af2c2d024f3203f5 input=d7597c7f5327117b]*/
|
||||
{
|
||||
PyObject *result;
|
||||
|
||||
|
|
|
|||
|
|
@ -1039,6 +1039,8 @@ _functools_cmp_to_key_impl(PyObject *module, PyObject *mycmp)
|
|||
/* reduce (used to be a builtin) ********************************************/
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
_functools.reduce
|
||||
|
||||
function as func: object
|
||||
|
|
@ -1059,7 +1061,7 @@ calculates ((((1 + 2) + 3) + 4) + 5).
|
|||
static PyObject *
|
||||
_functools_reduce_impl(PyObject *module, PyObject *func, PyObject *seq,
|
||||
PyObject *result)
|
||||
/*[clinic end generated code: output=30d898fe1267c79d input=1511e9a8c38581ac]*/
|
||||
/*[clinic end generated code: output=30d898fe1267c79d input=4ccfb74548ce5170]*/
|
||||
{
|
||||
PyObject *args, *it;
|
||||
|
||||
|
|
|
|||
|
|
@ -377,6 +377,7 @@ gdbm_ass_sub(PyObject *op, PyObject *v, PyObject *w)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@critical_section
|
||||
_gdbm.gdbm.setdefault
|
||||
|
||||
|
|
@ -390,7 +391,7 @@ Get value for key, or set it to default and return default if not present.
|
|||
static PyObject *
|
||||
_gdbm_gdbm_setdefault_impl(gdbmobject *self, PyObject *key,
|
||||
PyObject *default_value)
|
||||
/*[clinic end generated code: output=f3246e880509f142 input=854374cd81ab51b6]*/
|
||||
/*[clinic end generated code: output=f3246e880509f142 input=f4008b358165bbb8]*/
|
||||
{
|
||||
PyObject *res;
|
||||
|
||||
|
|
|
|||
|
|
@ -1501,6 +1501,7 @@ _hashlib_openssl_sha3_512_impl(PyObject *module, PyObject *data,
|
|||
|
||||
#ifdef PY_OPENSSL_HAS_SHAKE
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_hashlib.openssl_shake_128
|
||||
|
||||
data: object(c_default="NULL") = b''
|
||||
|
|
@ -1515,12 +1516,13 @@ Returns a shake-128 variable hash object; optionally initialized with a string
|
|||
static PyObject *
|
||||
_hashlib_openssl_shake_128_impl(PyObject *module, PyObject *data,
|
||||
int usedforsecurity, PyObject *string)
|
||||
/*[clinic end generated code: output=4e6afed8d18980ad input=373c3f1c93d87b37]*/
|
||||
/*[clinic end generated code: output=4e6afed8d18980ad input=0d2803af1158b23c]*/
|
||||
{
|
||||
CALL_HASHLIB_NEW(module, Py_hash_shake_128, data, string, usedforsecurity);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_hashlib.openssl_shake_256
|
||||
|
||||
data: object(c_default="NULL") = b''
|
||||
|
|
@ -1535,7 +1537,7 @@ Returns a shake-256 variable hash object; optionally initialized with a string
|
|||
static PyObject *
|
||||
_hashlib_openssl_shake_256_impl(PyObject *module, PyObject *data,
|
||||
int usedforsecurity, PyObject *string)
|
||||
/*[clinic end generated code: output=62481bce4a77d16c input=101c139ea2ddfcbf]*/
|
||||
/*[clinic end generated code: output=62481bce4a77d16c input=f27b98d9c749f55d]*/
|
||||
{
|
||||
CALL_HASHLIB_NEW(module, Py_hash_shake_256, data, string, usedforsecurity);
|
||||
}
|
||||
|
|
@ -1544,6 +1546,7 @@ _hashlib_openssl_shake_256_impl(PyObject *module, PyObject *data,
|
|||
#undef CALL_HASHLIB_NEW
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_hashlib.pbkdf2_hmac as pbkdf2_hmac
|
||||
|
||||
hash_name: str
|
||||
|
|
@ -1559,7 +1562,7 @@ static PyObject *
|
|||
pbkdf2_hmac_impl(PyObject *module, const char *hash_name,
|
||||
Py_buffer *password, Py_buffer *salt, long iterations,
|
||||
PyObject *dklen_obj)
|
||||
/*[clinic end generated code: output=144b76005416599b input=ed3ab0d2d28b5d5c]*/
|
||||
/*[clinic end generated code: output=144b76005416599b input=83417fbd9ec2b8a3]*/
|
||||
{
|
||||
_hashlibstate *state = get_hashlib_state(module);
|
||||
PyObject *key_obj = NULL;
|
||||
|
|
@ -2092,6 +2095,8 @@ _hashlib_HMAC_digest_impl(HMACobject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
_hashlib.HMAC.hexdigest
|
||||
|
||||
Return hexadecimal digest of the bytes passed to the update() method so far.
|
||||
|
|
@ -2102,7 +2107,7 @@ environments.
|
|||
|
||||
static PyObject *
|
||||
_hashlib_HMAC_hexdigest_impl(HMACobject *self)
|
||||
/*[clinic end generated code: output=80d825be1eaae6a7 input=5abc42702874ddcf]*/
|
||||
/*[clinic end generated code: output=80d825be1eaae6a7 input=5e48db83ab1a4d19]*/
|
||||
{
|
||||
unsigned char digest[EVP_MAX_MD_SIZE];
|
||||
unsigned int digest_size = _hashlib_hmac_digest_size(self);
|
||||
|
|
|
|||
|
|
@ -1328,6 +1328,7 @@ finally:
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_interpreters.is_shareable
|
||||
obj: object
|
||||
|
||||
|
|
@ -1336,7 +1337,7 @@ Return True if the object's data may be shared between interpreters and False ot
|
|||
|
||||
static PyObject *
|
||||
_interpreters_is_shareable_impl(PyObject *module, PyObject *obj)
|
||||
/*[clinic end generated code: output=227856926a22940b input=72b9a36bdf1d2a53]*/
|
||||
/*[clinic end generated code: output=227856926a22940b input=95f888d35a6d4bb3]*/
|
||||
{
|
||||
PyThreadState *tstate = _PyThreadState_GET();
|
||||
if (_PyObject_CheckXIData(tstate, obj) == 0) {
|
||||
|
|
@ -1491,6 +1492,7 @@ _interpreters_decref_impl(PyObject *module, PyObject *id, int restricted)
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_interpreters.capture_exception
|
||||
exc as exc_arg: object = None
|
||||
|
||||
|
|
@ -1502,7 +1504,7 @@ The returned snapshot is the same as what _interpreters.exec() returns.
|
|||
|
||||
static PyObject *
|
||||
_interpreters_capture_exception_impl(PyObject *module, PyObject *exc_arg)
|
||||
/*[clinic end generated code: output=ef3f5393ef9c88a6 input=32045341e979bc9e]*/
|
||||
/*[clinic end generated code: output=ef3f5393ef9c88a6 input=6c4dcb78fb722217]*/
|
||||
{
|
||||
PyObject *exc = exc_arg;
|
||||
if (exc == NULL || exc == Py_None) {
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ PyDoc_STRVAR(module_doc,
|
|||
/*[clinic input]
|
||||
module _io
|
||||
|
||||
@permit_long_docstring_body
|
||||
_io.open
|
||||
file: object
|
||||
mode: str = "r"
|
||||
|
|
@ -199,7 +200,7 @@ static PyObject *
|
|||
_io_open_impl(PyObject *module, PyObject *file, const char *mode,
|
||||
int buffering, const char *encoding, const char *errors,
|
||||
const char *newline, int closefd, PyObject *opener)
|
||||
/*[clinic end generated code: output=aefafc4ce2b46dc0 input=28027fdaabb8d744]*/
|
||||
/*[clinic end generated code: output=aefafc4ce2b46dc0 input=8629579a442a99e3]*/
|
||||
{
|
||||
size_t i;
|
||||
|
||||
|
|
@ -498,6 +499,7 @@ _io_text_encoding_impl(PyObject *module, PyObject *encoding, int stacklevel)
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_io.open_code
|
||||
|
||||
path : unicode
|
||||
|
|
@ -511,7 +513,7 @@ with calling open(path, 'rb').
|
|||
|
||||
static PyObject *
|
||||
_io_open_code_impl(PyObject *module, PyObject *path)
|
||||
/*[clinic end generated code: output=2fe4ecbd6f3d6844 input=f5c18e23f4b2ed9f]*/
|
||||
/*[clinic end generated code: output=2fe4ecbd6f3d6844 input=53d38a37d780d034]*/
|
||||
{
|
||||
return PyFile_OpenCodeObject(path);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -172,6 +172,7 @@ _io__BufferedIOBase_read_impl(PyObject *self, PyTypeObject *cls,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_io._BufferedIOBase.read1
|
||||
|
||||
cls: defining_class
|
||||
|
|
@ -187,7 +188,7 @@ A short result does not imply that EOF is imminent.
|
|||
static PyObject *
|
||||
_io__BufferedIOBase_read1_impl(PyObject *self, PyTypeObject *cls,
|
||||
int Py_UNUSED(size))
|
||||
/*[clinic end generated code: output=2e7fc62972487eaa input=af76380e020fd9e6]*/
|
||||
/*[clinic end generated code: output=2e7fc62972487eaa input=1e76df255063afd6]*/
|
||||
{
|
||||
_PyIO_State *state = get_io_state_by_cls(cls);
|
||||
return bufferediobase_unsupported(state, "read1");
|
||||
|
|
|
|||
|
|
@ -722,6 +722,7 @@ new_buffersize(fileio *self, size_t currentsize)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_io.FileIO.readall
|
||||
|
||||
Read all data from the file, returned as bytes.
|
||||
|
|
@ -735,7 +736,7 @@ data is available (EAGAIN is returned before bytes are read) returns None.
|
|||
|
||||
static PyObject *
|
||||
_io_FileIO_readall_impl(fileio *self)
|
||||
/*[clinic end generated code: output=faa0292b213b4022 input=1e19849857f5d0a1]*/
|
||||
/*[clinic end generated code: output=faa0292b213b4022 input=10d8b2ec403302dc]*/
|
||||
{
|
||||
Py_off_t pos, end;
|
||||
PyObject *result;
|
||||
|
|
@ -843,6 +844,7 @@ _io_FileIO_readall_impl(fileio *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_io.FileIO.read
|
||||
cls: defining_class
|
||||
size: Py_ssize_t(accept={int, NoneType}) = -1
|
||||
|
|
@ -862,7 +864,7 @@ bytes object at EOF.
|
|||
|
||||
static PyObject *
|
||||
_io_FileIO_read_impl(fileio *self, PyTypeObject *cls, Py_ssize_t size)
|
||||
/*[clinic end generated code: output=bbd749c7c224143e input=cf21fddef7d38ab6]*/
|
||||
/*[clinic end generated code: output=bbd749c7c224143e input=752d1ad3db8564a5]*/
|
||||
{
|
||||
char *ptr;
|
||||
Py_ssize_t n;
|
||||
|
|
@ -1018,6 +1020,7 @@ portable_lseek(fileio *self, PyObject *posobj, int whence, bool suppress_pipe_er
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_io.FileIO.seek
|
||||
pos: object
|
||||
whence: int = 0
|
||||
|
|
@ -1036,7 +1039,7 @@ Note that not all file objects are seekable.
|
|||
|
||||
static PyObject *
|
||||
_io_FileIO_seek_impl(fileio *self, PyObject *pos, int whence)
|
||||
/*[clinic end generated code: output=c976acdf054e6655 input=0439194b0774d454]*/
|
||||
/*[clinic end generated code: output=c976acdf054e6655 input=f077c492a84c9e62]*/
|
||||
{
|
||||
if (self->fd < 0)
|
||||
return err_closed();
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ iobase_unsupported(_PyIO_State *state, const char *message)
|
|||
/* Positioning */
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_io._IOBase.seek
|
||||
cls: defining_class
|
||||
offset: int(unused=True)
|
||||
|
|
@ -116,7 +117,7 @@ Return the new absolute position.
|
|||
static PyObject *
|
||||
_io__IOBase_seek_impl(PyObject *self, PyTypeObject *cls,
|
||||
int Py_UNUSED(offset), int Py_UNUSED(whence))
|
||||
/*[clinic end generated code: output=8bd74ea6538ded53 input=74211232b363363e]*/
|
||||
/*[clinic end generated code: output=8bd74ea6538ded53 input=a21b5aad416ff6a9]*/
|
||||
{
|
||||
_PyIO_State *state = get_io_state_by_cls(cls);
|
||||
return iobase_unsupported(state, "seek");
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ _unsupported(_PyIO_State *state, const char *message)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_io._TextIOBase.detach
|
||||
cls: defining_class
|
||||
/
|
||||
|
|
@ -64,7 +65,7 @@ After the underlying buffer has been detached, the TextIO is in an unusable stat
|
|||
|
||||
static PyObject *
|
||||
_io__TextIOBase_detach_impl(PyObject *self, PyTypeObject *cls)
|
||||
/*[clinic end generated code: output=50915f40c609eaa4 input=987ca3640d0a3776]*/
|
||||
/*[clinic end generated code: output=50915f40c609eaa4 input=8cd0652c17d7f015]*/
|
||||
{
|
||||
_PyIO_State *state = get_io_state_by_cls(cls);
|
||||
return _unsupported(state, "detach");
|
||||
|
|
|
|||
|
|
@ -1125,6 +1125,7 @@ error:
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_lzma.LZMADecompressor.decompress
|
||||
|
||||
data: Py_buffer
|
||||
|
|
@ -1149,7 +1150,7 @@ the unused_data attribute.
|
|||
static PyObject *
|
||||
_lzma_LZMADecompressor_decompress_impl(Decompressor *self, Py_buffer *data,
|
||||
Py_ssize_t max_length)
|
||||
/*[clinic end generated code: output=ef4e20ec7122241d input=60c1f135820e309d]*/
|
||||
/*[clinic end generated code: output=ef4e20ec7122241d input=d5cbd45801b4b8b0]*/
|
||||
{
|
||||
PyObject *result = NULL;
|
||||
|
||||
|
|
@ -1471,6 +1472,7 @@ error:
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_lzma._decode_filter_properties
|
||||
filter_id: lzma_vli
|
||||
encoded_props: Py_buffer
|
||||
|
|
@ -1484,7 +1486,7 @@ The result does not include the filter ID itself, only the options.
|
|||
static PyObject *
|
||||
_lzma__decode_filter_properties_impl(PyObject *module, lzma_vli filter_id,
|
||||
Py_buffer *encoded_props)
|
||||
/*[clinic end generated code: output=714fd2ef565d5c60 input=246410800782160c]*/
|
||||
/*[clinic end generated code: output=714fd2ef565d5c60 input=b9750bf909109bbe]*/
|
||||
{
|
||||
lzma_filter filter;
|
||||
lzma_ret lzret;
|
||||
|
|
|
|||
|
|
@ -956,6 +956,7 @@ do_fork_exec(char *const exec_array[],
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_posixsubprocess.fork_exec as subprocess_fork_exec
|
||||
args as process_args: object
|
||||
executable_list: object
|
||||
|
|
@ -1016,7 +1017,7 @@ subprocess_fork_exec_impl(PyObject *module, PyObject *process_args,
|
|||
PyObject *extra_groups_packed,
|
||||
PyObject *uid_object, int child_umask,
|
||||
PyObject *preexec_fn)
|
||||
/*[clinic end generated code: output=288464dc56e373c7 input=f311c3bcb5dd55c8]*/
|
||||
/*[clinic end generated code: output=288464dc56e373c7 input=58e0db771686f4f6]*/
|
||||
{
|
||||
PyObject *converted_args = NULL, *fast_args = NULL;
|
||||
PyObject *preexec_fn_args_tuple = NULL;
|
||||
|
|
|
|||
|
|
@ -2515,6 +2515,8 @@ class _remote_debugging.RemoteUnwinder "RemoteUnwinderObject *" "&RemoteUnwinder
|
|||
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=55f164d8803318be]*/
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
_remote_debugging.RemoteUnwinder.__init__
|
||||
pid: int
|
||||
*
|
||||
|
|
@ -2548,7 +2550,7 @@ _remote_debugging_RemoteUnwinder___init___impl(RemoteUnwinderObject *self,
|
|||
int pid, int all_threads,
|
||||
int only_active_thread,
|
||||
int debug)
|
||||
/*[clinic end generated code: output=13ba77598ecdcbe1 input=8f8f12504e17da04]*/
|
||||
/*[clinic end generated code: output=13ba77598ecdcbe1 input=cfc21663fbe263c4]*/
|
||||
{
|
||||
// Validate that all_threads and only_active_thread are not both True
|
||||
if (all_threads && only_active_thread) {
|
||||
|
|
@ -2643,6 +2645,7 @@ _remote_debugging_RemoteUnwinder___init___impl(RemoteUnwinderObject *self,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
@critical_section
|
||||
_remote_debugging.RemoteUnwinder.get_stack_trace
|
||||
|
||||
|
|
@ -2681,7 +2684,7 @@ Raises:
|
|||
|
||||
static PyObject *
|
||||
_remote_debugging_RemoteUnwinder_get_stack_trace_impl(RemoteUnwinderObject *self)
|
||||
/*[clinic end generated code: output=666192b90c69d567 input=f756f341206f9116]*/
|
||||
/*[clinic end generated code: output=666192b90c69d567 input=c527a4b858601408]*/
|
||||
{
|
||||
PyObject* result = NULL;
|
||||
// Read interpreter state into opaque buffer
|
||||
|
|
@ -2787,6 +2790,8 @@ exit:
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
@critical_section
|
||||
_remote_debugging.RemoteUnwinder.get_all_awaited_by
|
||||
|
||||
|
|
@ -2832,7 +2837,7 @@ Example output:
|
|||
|
||||
static PyObject *
|
||||
_remote_debugging_RemoteUnwinder_get_all_awaited_by_impl(RemoteUnwinderObject *self)
|
||||
/*[clinic end generated code: output=6a49cd345e8aec53 input=a452c652bb00701a]*/
|
||||
/*[clinic end generated code: output=6a49cd345e8aec53 input=307f754cbe38250c]*/
|
||||
{
|
||||
if (!self->async_debug_offsets_available) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "AsyncioDebug section not available");
|
||||
|
|
@ -2875,6 +2880,8 @@ result_err:
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
@critical_section
|
||||
_remote_debugging.RemoteUnwinder.get_async_stack_trace
|
||||
|
||||
|
|
@ -2921,7 +2928,7 @@ Example output (similar structure to get_all_awaited_by but only for running tas
|
|||
|
||||
static PyObject *
|
||||
_remote_debugging_RemoteUnwinder_get_async_stack_trace_impl(RemoteUnwinderObject *self)
|
||||
/*[clinic end generated code: output=6433d52b55e87bbe input=8744b47c9ec2220a]*/
|
||||
/*[clinic end generated code: output=6433d52b55e87bbe input=6129b7d509a887c9]*/
|
||||
{
|
||||
if (!self->async_debug_offsets_available) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "AsyncioDebug section not available");
|
||||
|
|
|
|||
|
|
@ -164,6 +164,7 @@ read_multiple(pysqlite_Blob *self, Py_ssize_t length, Py_ssize_t offset)
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_sqlite3.Blob.read as blob_read
|
||||
|
||||
length: int = -1
|
||||
|
|
@ -179,7 +180,7 @@ end of the blob.
|
|||
|
||||
static PyObject *
|
||||
blob_read_impl(pysqlite_Blob *self, int length)
|
||||
/*[clinic end generated code: output=1fc99b2541360dde input=f2e4aa4378837250]*/
|
||||
/*[clinic end generated code: output=1fc99b2541360dde input=e5715bcddbcfca5a]*/
|
||||
{
|
||||
if (!check_blob(self)) {
|
||||
return NULL;
|
||||
|
|
@ -232,6 +233,7 @@ inner_write(pysqlite_Blob *self, const void *buf, Py_ssize_t len,
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_sqlite3.Blob.write as blob_write
|
||||
|
||||
data: Py_buffer
|
||||
|
|
@ -245,7 +247,7 @@ blob will result in an exception being raised.
|
|||
|
||||
static PyObject *
|
||||
blob_write_impl(pysqlite_Blob *self, Py_buffer *data)
|
||||
/*[clinic end generated code: output=b34cf22601b570b2 input=a84712f24a028e6d]*/
|
||||
/*[clinic end generated code: output=b34cf22601b570b2 input=203d3458f244814b]*/
|
||||
{
|
||||
if (!check_blob(self)) {
|
||||
return NULL;
|
||||
|
|
@ -261,6 +263,7 @@ blob_write_impl(pysqlite_Blob *self, Py_buffer *data)
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_sqlite3.Blob.seek as blob_seek
|
||||
|
||||
offset: int
|
||||
|
|
@ -276,7 +279,7 @@ and os.SEEK_END (seek relative to the blob's end).
|
|||
|
||||
static PyObject *
|
||||
blob_seek_impl(pysqlite_Blob *self, int offset, int origin)
|
||||
/*[clinic end generated code: output=854c5a0e208547a5 input=5da9a07e55fe6bb6]*/
|
||||
/*[clinic end generated code: output=854c5a0e208547a5 input=ee4d88e1dc0b1048]*/
|
||||
{
|
||||
if (!check_blob(self)) {
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -1566,6 +1566,7 @@ pysqlite_connection_set_authorizer_impl(pysqlite_Connection *self,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_sqlite3.Connection.set_progress_handler as pysqlite_connection_set_progress_handler
|
||||
|
||||
cls: defining_class
|
||||
|
|
@ -1587,7 +1588,7 @@ static PyObject *
|
|||
pysqlite_connection_set_progress_handler_impl(pysqlite_Connection *self,
|
||||
PyTypeObject *cls,
|
||||
PyObject *callable, int n)
|
||||
/*[clinic end generated code: output=0739957fd8034a50 input=74c943f1ae7d8880]*/
|
||||
/*[clinic end generated code: output=0739957fd8034a50 input=3ecce6c915922ad4]*/
|
||||
{
|
||||
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
|
||||
return NULL;
|
||||
|
|
@ -2215,6 +2216,7 @@ pysqlite_connection_create_collation_impl(pysqlite_Connection *self,
|
|||
|
||||
#ifdef PY_SQLITE_HAVE_SERIALIZE
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_sqlite3.Connection.serialize as serialize
|
||||
|
||||
*
|
||||
|
|
@ -2231,7 +2233,7 @@ were backed up to disk.
|
|||
|
||||
static PyObject *
|
||||
serialize_impl(pysqlite_Connection *self, const char *name)
|
||||
/*[clinic end generated code: output=97342b0e55239dd3 input=d2eb5194a65abe2b]*/
|
||||
/*[clinic end generated code: output=97342b0e55239dd3 input=963e617cdf75c747]*/
|
||||
{
|
||||
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
|
||||
return NULL;
|
||||
|
|
@ -2265,6 +2267,7 @@ serialize_impl(pysqlite_Connection *self, const char *name)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_sqlite3.Connection.deserialize as deserialize
|
||||
|
||||
data: Py_buffer(accept={buffer, str})
|
||||
|
|
@ -2287,7 +2290,7 @@ currently in a read transaction or is involved in a backup operation.
|
|||
static PyObject *
|
||||
deserialize_impl(pysqlite_Connection *self, Py_buffer *data,
|
||||
const char *name)
|
||||
/*[clinic end generated code: output=e394c798b98bad89 input=1be4ca1faacf28f2]*/
|
||||
/*[clinic end generated code: output=e394c798b98bad89 input=037e94599aaa5b5c]*/
|
||||
{
|
||||
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
|
||||
return NULL;
|
||||
|
|
@ -2401,6 +2404,7 @@ pysqlite_connection_exit_impl(pysqlite_Connection *self, PyObject *exc_type,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_sqlite3.Connection.setlimit as setlimit
|
||||
|
||||
category: int
|
||||
|
|
@ -2419,7 +2423,7 @@ the prior value of the limit is returned.
|
|||
|
||||
static PyObject *
|
||||
setlimit_impl(pysqlite_Connection *self, int category, int limit)
|
||||
/*[clinic end generated code: output=0d208213f8d68ccd input=9bd469537e195635]*/
|
||||
/*[clinic end generated code: output=0d208213f8d68ccd input=bf06e06a21eb37e2]*/
|
||||
{
|
||||
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -855,6 +855,7 @@ _sre_SRE_Pattern_fullmatch_impl(PatternObject *self, PyTypeObject *cls,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_sre.SRE_Pattern.search
|
||||
|
||||
cls: defining_class
|
||||
|
|
@ -872,7 +873,7 @@ static PyObject *
|
|||
_sre_SRE_Pattern_search_impl(PatternObject *self, PyTypeObject *cls,
|
||||
PyObject *string, Py_ssize_t pos,
|
||||
Py_ssize_t endpos)
|
||||
/*[clinic end generated code: output=bd7f2d9d583e1463 input=afa9afb66a74a4b3]*/
|
||||
/*[clinic end generated code: output=bd7f2d9d583e1463 input=05e9feee0334c156]*/
|
||||
{
|
||||
_sremodulestate *module_state = get_sre_module_state_by_class(cls);
|
||||
SRE_STATE state;
|
||||
|
|
@ -997,6 +998,7 @@ error:
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_sre.SRE_Pattern.finditer
|
||||
|
||||
cls: defining_class
|
||||
|
|
@ -1014,7 +1016,7 @@ static PyObject *
|
|||
_sre_SRE_Pattern_finditer_impl(PatternObject *self, PyTypeObject *cls,
|
||||
PyObject *string, Py_ssize_t pos,
|
||||
Py_ssize_t endpos)
|
||||
/*[clinic end generated code: output=1791dbf3618ade56 input=812e332a4848cbaf]*/
|
||||
/*[clinic end generated code: output=1791dbf3618ade56 input=ee28865796048023]*/
|
||||
{
|
||||
_sremodulestate *module_state = get_sre_module_state_by_class(cls);
|
||||
PyObject* scanner;
|
||||
|
|
@ -1416,6 +1418,7 @@ error:
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_sre.SRE_Pattern.sub
|
||||
|
||||
cls: defining_class
|
||||
|
|
@ -1430,7 +1433,7 @@ Return the string obtained by replacing the leftmost non-overlapping occurrences
|
|||
static PyObject *
|
||||
_sre_SRE_Pattern_sub_impl(PatternObject *self, PyTypeObject *cls,
|
||||
PyObject *repl, PyObject *string, Py_ssize_t count)
|
||||
/*[clinic end generated code: output=4be141ab04bca60d input=d8d1d4ac2311a07c]*/
|
||||
/*[clinic end generated code: output=4be141ab04bca60d input=eba511fd1c4908b7]*/
|
||||
{
|
||||
_sremodulestate *module_state = get_sre_module_state_by_class(cls);
|
||||
|
||||
|
|
@ -1438,6 +1441,7 @@ _sre_SRE_Pattern_sub_impl(PatternObject *self, PyTypeObject *cls,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_sre.SRE_Pattern.subn
|
||||
|
||||
cls: defining_class
|
||||
|
|
@ -1453,7 +1457,7 @@ static PyObject *
|
|||
_sre_SRE_Pattern_subn_impl(PatternObject *self, PyTypeObject *cls,
|
||||
PyObject *repl, PyObject *string,
|
||||
Py_ssize_t count)
|
||||
/*[clinic end generated code: output=da02fd85258b1e1f input=8b78a65b8302e58d]*/
|
||||
/*[clinic end generated code: output=da02fd85258b1e1f input=6a5bb5b61717abf0]*/
|
||||
{
|
||||
_sremodulestate *module_state = get_sre_module_state_by_class(cls);
|
||||
|
||||
|
|
@ -2372,6 +2376,7 @@ match_getslice(MatchObject* self, PyObject* index, PyObject* def)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_sre.SRE_Match.expand
|
||||
|
||||
template: object
|
||||
|
|
@ -2381,7 +2386,7 @@ Return the string obtained by doing backslash substitution on the string templat
|
|||
|
||||
static PyObject *
|
||||
_sre_SRE_Match_expand_impl(MatchObject *self, PyObject *template)
|
||||
/*[clinic end generated code: output=931b58ccc323c3a1 input=4bfdb22c2f8b146a]*/
|
||||
/*[clinic end generated code: output=931b58ccc323c3a1 input=dc74d81265376ac3]*/
|
||||
{
|
||||
_sremodulestate *module_state = get_sre_module_state_by_class(Py_TYPE(self));
|
||||
PyObject *filter = compile_template(module_state, self->pattern, template);
|
||||
|
|
@ -2470,6 +2475,7 @@ _sre_SRE_Match_groups_impl(MatchObject *self, PyObject *default_value)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_sre.SRE_Match.groupdict
|
||||
|
||||
default: object = None
|
||||
|
|
@ -2480,7 +2486,7 @@ Return a dictionary containing all the named subgroups of the match, keyed by th
|
|||
|
||||
static PyObject *
|
||||
_sre_SRE_Match_groupdict_impl(MatchObject *self, PyObject *default_value)
|
||||
/*[clinic end generated code: output=29917c9073e41757 input=0ded7960b23780aa]*/
|
||||
/*[clinic end generated code: output=29917c9073e41757 input=a8d3a1dc80336872]*/
|
||||
{
|
||||
PyObject *result;
|
||||
PyObject *key;
|
||||
|
|
|
|||
|
|
@ -2269,6 +2269,7 @@ _ssl__SSLSocket_compression_impl(PySSLSocket *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
@critical_section
|
||||
@getter
|
||||
_ssl._SSLSocket.context
|
||||
|
|
@ -2282,12 +2283,13 @@ SSLSocket before the cryptographic exchange handshake messages.
|
|||
|
||||
static PyObject *
|
||||
_ssl__SSLSocket_context_get_impl(PySSLSocket *self)
|
||||
/*[clinic end generated code: output=d23e82f72f32e3d7 input=7cbb97407c2ace30]*/
|
||||
/*[clinic end generated code: output=d23e82f72f32e3d7 input=0cc8e773a079295e]*/
|
||||
{
|
||||
return Py_NewRef(self->ctx);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
@critical_section
|
||||
@setter
|
||||
_ssl._SSLSocket.context
|
||||
|
|
@ -2295,7 +2297,7 @@ _ssl._SSLSocket.context
|
|||
|
||||
static int
|
||||
_ssl__SSLSocket_context_set_impl(PySSLSocket *self, PyObject *value)
|
||||
/*[clinic end generated code: output=6b0a6cc5cf33d9fe input=48ece77724fd9dd4]*/
|
||||
/*[clinic end generated code: output=6b0a6cc5cf33d9fe input=f7fc1674b660df96]*/
|
||||
{
|
||||
if (PyObject_TypeCheck(value, self->ctx->state->PySSLContext_Type)) {
|
||||
Py_SETREF(self->ctx, (PySSLContext *)Py_NewRef(value));
|
||||
|
|
@ -2546,6 +2548,8 @@ _ssl__SSLSocket_uses_ktls_for_recv_impl(PySSLSocket *self)
|
|||
|
||||
#ifdef BIO_get_ktls_send
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
@critical_section
|
||||
_ssl._SSLSocket.sendfile
|
||||
fd: int
|
||||
|
|
@ -2566,7 +2570,7 @@ The meaning of flags is platform dependent.
|
|||
static PyObject *
|
||||
_ssl__SSLSocket_sendfile_impl(PySSLSocket *self, int fd, Py_off_t offset,
|
||||
size_t size, int flags)
|
||||
/*[clinic end generated code: output=0c6815b0719ca8d5 input=dfc1b162bb020de1]*/
|
||||
/*[clinic end generated code: output=0c6815b0719ca8d5 input=1f193e681bbae664]*/
|
||||
{
|
||||
Py_ssize_t retval;
|
||||
int sockstate;
|
||||
|
|
@ -2793,6 +2797,7 @@ error:
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@critical_section
|
||||
_ssl._SSLSocket.pending
|
||||
|
||||
|
|
@ -2801,7 +2806,7 @@ Returns the number of already decrypted bytes available for read, pending on the
|
|||
|
||||
static PyObject *
|
||||
_ssl__SSLSocket_pending_impl(PySSLSocket *self)
|
||||
/*[clinic end generated code: output=983d9fecdc308a83 input=32ab982a254e8866]*/
|
||||
/*[clinic end generated code: output=983d9fecdc308a83 input=042dcc48bdf3e312]*/
|
||||
{
|
||||
int count = 0;
|
||||
_PySSLError err;
|
||||
|
|
@ -3085,6 +3090,7 @@ error:
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
@critical_section
|
||||
_ssl._SSLSocket.get_channel_binding
|
||||
cb_type: str = "tls-unique"
|
||||
|
|
@ -3099,7 +3105,7 @@ Only 'tls-unique' channel binding data from RFC 5929 is supported.
|
|||
static PyObject *
|
||||
_ssl__SSLSocket_get_channel_binding_impl(PySSLSocket *self,
|
||||
const char *cb_type)
|
||||
/*[clinic end generated code: output=34bac9acb6a61d31 input=e008004fc08744db]*/
|
||||
/*[clinic end generated code: output=34bac9acb6a61d31 input=26fad522435ecca1]*/
|
||||
{
|
||||
char buf[PySSL_CB_MAXLEN];
|
||||
size_t len;
|
||||
|
|
@ -5092,6 +5098,8 @@ error:
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
@critical_section
|
||||
@getter
|
||||
_ssl._SSLContext.sni_callback
|
||||
|
|
@ -5106,7 +5114,7 @@ See RFC 6066 for details of the SNI extension.
|
|||
|
||||
static PyObject *
|
||||
_ssl__SSLContext_sni_callback_get_impl(PySSLContext *self)
|
||||
/*[clinic end generated code: output=961e6575cdfaf036 input=9b2473c5e984cfe6]*/
|
||||
/*[clinic end generated code: output=961e6575cdfaf036 input=3aee06696b0874d9]*/
|
||||
{
|
||||
PyObject *cb = self->set_sni_cb;
|
||||
if (cb == NULL) {
|
||||
|
|
@ -5116,6 +5124,8 @@ _ssl__SSLContext_sni_callback_get_impl(PySSLContext *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
@critical_section
|
||||
@setter
|
||||
_ssl._SSLContext.sni_callback
|
||||
|
|
@ -5123,7 +5133,7 @@ _ssl._SSLContext.sni_callback
|
|||
|
||||
static int
|
||||
_ssl__SSLContext_sni_callback_set_impl(PySSLContext *self, PyObject *value)
|
||||
/*[clinic end generated code: output=b32736c6b891f61a input=c3c4ff33540b3c85]*/
|
||||
/*[clinic end generated code: output=b32736c6b891f61a input=332def1d8c81d549]*/
|
||||
{
|
||||
if (self->protocol == PY_SSL_VERSION_TLS_CLIENT) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
|
|
@ -6150,6 +6160,7 @@ _ssl_RAND_bytes_impl(PyObject *module, int n)
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@critical_section
|
||||
_ssl.RAND_status
|
||||
|
||||
|
|
@ -6161,12 +6172,13 @@ using the ssl() function.
|
|||
|
||||
static PyObject *
|
||||
_ssl_RAND_status_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=7e0aaa2d39fdc1ad input=636fb5659ea2e727]*/
|
||||
/*[clinic end generated code: output=7e0aaa2d39fdc1ad input=aba24a3f3af3b184]*/
|
||||
{
|
||||
return PyBool_FromLong(RAND_status());
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@critical_section
|
||||
_ssl.get_default_verify_paths
|
||||
|
||||
|
|
@ -6177,7 +6189,7 @@ The values are 'cert_file_env', 'cert_file', 'cert_dir_env', 'cert_dir'.
|
|||
|
||||
static PyObject *
|
||||
_ssl_get_default_verify_paths_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=e5b62a466271928b input=c6ae00bc04eb2b6e]*/
|
||||
/*[clinic end generated code: output=e5b62a466271928b input=255507e1be890095]*/
|
||||
{
|
||||
PyObject *ofile_env = NULL;
|
||||
PyObject *ofile = NULL;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ add_string_value(PyObject *dict, const char *key, const char *str_value)
|
|||
#endif
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_sysconfig.config_vars
|
||||
|
||||
Returns a dictionary containing build variables intended to be exposed by sysconfig.
|
||||
|
|
@ -39,7 +40,7 @@ Returns a dictionary containing build variables intended to be exposed by syscon
|
|||
|
||||
static PyObject *
|
||||
_sysconfig_config_vars_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=9c41cdee63ea9487 input=391ff42f3af57d01]*/
|
||||
/*[clinic end generated code: output=9c41cdee63ea9487 input=fdda9cab12ca19fe]*/
|
||||
{
|
||||
PyObject *config = PyDict_New();
|
||||
if (config == NULL) {
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ _testcapi_exception_print_impl(PyObject *module, PyObject *exc, int legacy)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_testcapi.make_exception_with_doc
|
||||
name: str
|
||||
doc: str = NULL
|
||||
|
|
@ -95,7 +96,7 @@ static PyObject *
|
|||
_testcapi_make_exception_with_doc_impl(PyObject *module, const char *name,
|
||||
const char *doc, PyObject *base,
|
||||
PyObject *dict)
|
||||
/*[clinic end generated code: output=439f0d963c1ce2c4 input=23a73013f8a8795a]*/
|
||||
/*[clinic end generated code: output=439f0d963c1ce2c4 input=508b420b7f9253ed]*/
|
||||
{
|
||||
return PyErr_NewExceptionWithDoc(name, doc, base, dict);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -163,6 +163,7 @@ class _testcapi.VectorCallClass "PyObject *" "&PyType_Type"
|
|||
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=95c63c1a47f9a995]*/
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_testcapi.VectorCallClass.set_vectorcall
|
||||
|
||||
type: object(subclass_of="&PyType_Type", type="PyTypeObject *")
|
||||
|
|
@ -174,7 +175,7 @@ Set self's vectorcall function for `type` to one that returns "vectorcall"
|
|||
static PyObject *
|
||||
_testcapi_VectorCallClass_set_vectorcall_impl(PyObject *self,
|
||||
PyTypeObject *type)
|
||||
/*[clinic end generated code: output=b37f0466f15da903 input=840de66182c7d71a]*/
|
||||
/*[clinic end generated code: output=b37f0466f15da903 input=170fefc7ee77fd36]*/
|
||||
{
|
||||
if (!PyObject_TypeCheck(self, type)) {
|
||||
return PyErr_Format(
|
||||
|
|
|
|||
|
|
@ -3212,6 +3212,8 @@ _tkinter_create_impl(PyObject *module, const char *screenName,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
_tkinter.setbusywaitinterval
|
||||
|
||||
new_val: int
|
||||
|
|
@ -3224,7 +3226,7 @@ It should be set to a divisor of the maximum time between frames in an animation
|
|||
|
||||
static PyObject *
|
||||
_tkinter_setbusywaitinterval_impl(PyObject *module, int new_val)
|
||||
/*[clinic end generated code: output=42bf7757dc2d0ab6 input=deca1d6f9e6dae47]*/
|
||||
/*[clinic end generated code: output=42bf7757dc2d0ab6 input=07b82a04b56625e1]*/
|
||||
{
|
||||
if (new_val < 0) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
|
|
@ -3236,6 +3238,7 @@ _tkinter_setbusywaitinterval_impl(PyObject *module, int new_val)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_tkinter.getbusywaitinterval -> int
|
||||
|
||||
Return the current busy-wait interval between successive calls to Tcl_DoOneEvent in a threaded Python interpreter.
|
||||
|
|
@ -3243,7 +3246,7 @@ Return the current busy-wait interval between successive calls to Tcl_DoOneEvent
|
|||
|
||||
static int
|
||||
_tkinter_getbusywaitinterval_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=23b72d552001f5c7 input=a695878d2d576a84]*/
|
||||
/*[clinic end generated code: output=23b72d552001f5c7 input=62d5b36ddab3976b]*/
|
||||
{
|
||||
return Tkinter_busywaitinterval;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -168,6 +168,7 @@ _tracemalloc_get_traced_memory_impl(PyObject *module)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_tracemalloc.reset_peak
|
||||
|
||||
Set the peak size of memory blocks traced by tracemalloc to the current size.
|
||||
|
|
@ -178,7 +179,7 @@ Do nothing if the tracemalloc module is not tracing memory allocations.
|
|||
|
||||
static PyObject *
|
||||
_tracemalloc_reset_peak_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=140c2870f691dbb2 input=18afd0635066e9ce]*/
|
||||
/*[clinic end generated code: output=140c2870f691dbb2 input=4103319210f46286]*/
|
||||
{
|
||||
_PyTraceMalloc_ResetPeak();
|
||||
Py_RETURN_NONE;
|
||||
|
|
|
|||
|
|
@ -548,6 +548,7 @@ zoneinfo_ZoneInfo_clear_cache_impl(PyTypeObject *type, PyTypeObject *cls,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
zoneinfo.ZoneInfo.utcoffset
|
||||
|
||||
cls: defining_class
|
||||
|
|
@ -560,7 +561,7 @@ Retrieve a timedelta representing the UTC offset in a zone at the given datetime
|
|||
static PyObject *
|
||||
zoneinfo_ZoneInfo_utcoffset_impl(PyObject *self, PyTypeObject *cls,
|
||||
PyObject *dt)
|
||||
/*[clinic end generated code: output=b71016c319ba1f91 input=2bb6c5364938f19c]*/
|
||||
/*[clinic end generated code: output=b71016c319ba1f91 input=8ce0dc2d179f01c5]*/
|
||||
{
|
||||
zoneinfo_state *state = zoneinfo_get_state_by_cls(cls);
|
||||
_ttinfo *tti = find_ttinfo(state, PyZoneInfo_ZoneInfo_CAST(self), dt);
|
||||
|
|
@ -571,6 +572,7 @@ zoneinfo_ZoneInfo_utcoffset_impl(PyObject *self, PyTypeObject *cls,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
zoneinfo.ZoneInfo.dst
|
||||
|
||||
cls: defining_class
|
||||
|
|
@ -582,7 +584,7 @@ Retrieve a timedelta representing the amount of DST applied in a zone at the giv
|
|||
|
||||
static PyObject *
|
||||
zoneinfo_ZoneInfo_dst_impl(PyObject *self, PyTypeObject *cls, PyObject *dt)
|
||||
/*[clinic end generated code: output=cb6168d7723a6ae6 input=2167fb80cf8645c6]*/
|
||||
/*[clinic end generated code: output=cb6168d7723a6ae6 input=22b2abdf9388423c]*/
|
||||
{
|
||||
zoneinfo_state *state = zoneinfo_get_state_by_cls(cls);
|
||||
_ttinfo *tti = find_ttinfo(state, PyZoneInfo_ZoneInfo_CAST(self), dt);
|
||||
|
|
@ -593,6 +595,7 @@ zoneinfo_ZoneInfo_dst_impl(PyObject *self, PyTypeObject *cls, PyObject *dt)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
zoneinfo.ZoneInfo.tzname
|
||||
|
||||
cls: defining_class
|
||||
|
|
@ -605,7 +608,7 @@ Retrieve a string containing the abbreviation for the time zone that applies in
|
|||
static PyObject *
|
||||
zoneinfo_ZoneInfo_tzname_impl(PyObject *self, PyTypeObject *cls,
|
||||
PyObject *dt)
|
||||
/*[clinic end generated code: output=3b6ae6c3053ea75a input=15a59a4f92ed1f1f]*/
|
||||
/*[clinic end generated code: output=3b6ae6c3053ea75a input=0882926c4e95a1e2]*/
|
||||
{
|
||||
zoneinfo_state *state = zoneinfo_get_state_by_cls(cls);
|
||||
_ttinfo *tti = find_ttinfo(state, PyZoneInfo_ZoneInfo_CAST(self), dt);
|
||||
|
|
|
|||
|
|
@ -460,6 +460,7 @@ _zstd_get_param_bounds_impl(PyObject *module, int parameter, int is_compress)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_zstd.get_frame_size
|
||||
|
||||
frame_buffer: Py_buffer
|
||||
|
|
@ -471,7 +472,7 @@ Get the size of a Zstandard frame, including the header and optional checksum.
|
|||
|
||||
static PyObject *
|
||||
_zstd_get_frame_size_impl(PyObject *module, Py_buffer *frame_buffer)
|
||||
/*[clinic end generated code: output=a7384c2f8780f442 input=3b9f73f8c8129d38]*/
|
||||
/*[clinic end generated code: output=a7384c2f8780f442 input=aac83b33045b5f43]*/
|
||||
{
|
||||
size_t frame_size;
|
||||
|
||||
|
|
@ -534,6 +535,7 @@ _zstd_get_frame_info_impl(PyObject *module, Py_buffer *frame_buffer)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_zstd.set_parameter_types
|
||||
|
||||
c_parameter_type: object(subclass_of='&PyType_Type')
|
||||
|
|
@ -547,7 +549,7 @@ Set CompressionParameter and DecompressionParameter types for validity check.
|
|||
static PyObject *
|
||||
_zstd_set_parameter_types_impl(PyObject *module, PyObject *c_parameter_type,
|
||||
PyObject *d_parameter_type)
|
||||
/*[clinic end generated code: output=f3313b1294f19502 input=75d7a953580fae5f]*/
|
||||
/*[clinic end generated code: output=f3313b1294f19502 input=0529e918dfe54863]*/
|
||||
{
|
||||
_zstd_state* mod_state = get_zstd_state(module);
|
||||
|
||||
|
|
|
|||
|
|
@ -583,6 +583,7 @@ error:
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_zstd.ZstdCompressor.compress
|
||||
|
||||
data: Py_buffer
|
||||
|
|
@ -600,7 +601,7 @@ the compression process.
|
|||
static PyObject *
|
||||
_zstd_ZstdCompressor_compress_impl(ZstdCompressor *self, Py_buffer *data,
|
||||
int mode)
|
||||
/*[clinic end generated code: output=ed7982d1cf7b4f98 input=ac2c21d180f579ea]*/
|
||||
/*[clinic end generated code: output=ed7982d1cf7b4f98 input=6018ed6cc729cea6]*/
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
|
|
@ -642,6 +643,7 @@ _zstd_ZstdCompressor_compress_impl(ZstdCompressor *self, Py_buffer *data,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_zstd.ZstdCompressor.flush
|
||||
|
||||
mode: int(c_default="ZSTD_e_end") = ZstdCompressor.FLUSH_FRAME
|
||||
|
|
@ -657,7 +659,7 @@ be used after this method is called.
|
|||
|
||||
static PyObject *
|
||||
_zstd_ZstdCompressor_flush_impl(ZstdCompressor *self, int mode)
|
||||
/*[clinic end generated code: output=b7cf2c8d64dcf2e3 input=0ab19627f323cdbc]*/
|
||||
/*[clinic end generated code: output=b7cf2c8d64dcf2e3 input=a9871ec742d79003]*/
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
|
|
@ -691,6 +693,7 @@ _zstd_ZstdCompressor_flush_impl(ZstdCompressor *self, int mode)
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_zstd.ZstdCompressor.set_pledged_input_size
|
||||
|
||||
size: zstd_contentsize
|
||||
|
|
@ -711,7 +714,7 @@ final chunk written may be lost.
|
|||
static PyObject *
|
||||
_zstd_ZstdCompressor_set_pledged_input_size_impl(ZstdCompressor *self,
|
||||
unsigned long long size)
|
||||
/*[clinic end generated code: output=3a09e55cc0e3b4f9 input=afd8a7d78cff2eb5]*/
|
||||
/*[clinic end generated code: output=3a09e55cc0e3b4f9 input=b4c87bcbd5ce6111]*/
|
||||
{
|
||||
// Error occured while converting argument, should be unreachable
|
||||
assert(size != ZSTD_CONTENTSIZE_ERROR);
|
||||
|
|
|
|||
|
|
@ -468,6 +468,7 @@ error:
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
@classmethod
|
||||
_zstd.ZstdDecompressor.__new__ as _zstd_ZstdDecompressor_new
|
||||
zstd_dict: object = None
|
||||
|
|
@ -484,7 +485,7 @@ function instead.
|
|||
static PyObject *
|
||||
_zstd_ZstdDecompressor_new_impl(PyTypeObject *type, PyObject *zstd_dict,
|
||||
PyObject *options)
|
||||
/*[clinic end generated code: output=590ca65c1102ff4a input=213daa57e3ea4062]*/
|
||||
/*[clinic end generated code: output=590ca65c1102ff4a input=ed8891edfd14cdaa]*/
|
||||
{
|
||||
ZstdDecompressor* self = PyObject_GC_New(ZstdDecompressor, type);
|
||||
if (self == NULL) {
|
||||
|
|
@ -569,6 +570,7 @@ ZstdDecompressor_dealloc(PyObject *ob)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
@getter
|
||||
_zstd.ZstdDecompressor.unused_data
|
||||
|
||||
|
|
@ -580,7 +582,7 @@ decompressed, unused input data after the frame. Otherwise this will be b''.
|
|||
|
||||
static PyObject *
|
||||
_zstd_ZstdDecompressor_unused_data_get_impl(ZstdDecompressor *self)
|
||||
/*[clinic end generated code: output=f3a20940f11b6b09 input=54d41ecd681a3444]*/
|
||||
/*[clinic end generated code: output=f3a20940f11b6b09 input=37c2c531ab56f914]*/
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
|
|
@ -609,6 +611,8 @@ _zstd_ZstdDecompressor_unused_data_get_impl(ZstdDecompressor *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
_zstd.ZstdDecompressor.decompress
|
||||
|
||||
data: Py_buffer
|
||||
|
|
@ -638,7 +642,7 @@ static PyObject *
|
|||
_zstd_ZstdDecompressor_decompress_impl(ZstdDecompressor *self,
|
||||
Py_buffer *data,
|
||||
Py_ssize_t max_length)
|
||||
/*[clinic end generated code: output=a4302b3c940dbec6 input=6463dfdf98091caa]*/
|
||||
/*[clinic end generated code: output=a4302b3c940dbec6 input=e5c905a774df1553]*/
|
||||
{
|
||||
PyObject *ret;
|
||||
/* Thread-safe code */
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ class _zstd.ZstdDict "ZstdDict *" "&zstd_dict_type_spec"
|
|||
#define ZstdDict_CAST(op) ((ZstdDict *)op)
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
@classmethod
|
||||
_zstd.ZstdDict.__new__ as _zstd_ZstdDict_new
|
||||
dict_content: Py_buffer
|
||||
|
|
@ -43,7 +44,7 @@ by multiple ZstdCompressor or ZstdDecompressor objects.
|
|||
static PyObject *
|
||||
_zstd_ZstdDict_new_impl(PyTypeObject *type, Py_buffer *dict_content,
|
||||
int is_raw)
|
||||
/*[clinic end generated code: output=685b7406a48b0949 input=9e8c493e31c98383]*/
|
||||
/*[clinic end generated code: output=685b7406a48b0949 input=b132ee40b784c293]*/
|
||||
{
|
||||
/* All dictionaries must be at least 8 bytes */
|
||||
if (dict_content->len < 8) {
|
||||
|
|
@ -153,6 +154,7 @@ _zstd_ZstdDict_dict_content_get_impl(ZstdDict *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
@getter
|
||||
_zstd.ZstdDict.as_digested_dict
|
||||
|
||||
|
|
@ -171,12 +173,13 @@ compress(dat, zstd_dict=zd.as_digested_dict)
|
|||
|
||||
static PyObject *
|
||||
_zstd_ZstdDict_as_digested_dict_get_impl(ZstdDict *self)
|
||||
/*[clinic end generated code: output=09b086e7a7320dbb input=ee45e1b4a48f6f2c]*/
|
||||
/*[clinic end generated code: output=09b086e7a7320dbb input=8d01ff0b8b043f2e]*/
|
||||
{
|
||||
return Py_BuildValue("Oi", self, DICT_TYPE_DIGESTED);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
@getter
|
||||
_zstd.ZstdDict.as_undigested_dict
|
||||
|
||||
|
|
@ -193,12 +196,13 @@ compress(dat, zstd_dict=zd.as_undigested_dict)
|
|||
|
||||
static PyObject *
|
||||
_zstd_ZstdDict_as_undigested_dict_get_impl(ZstdDict *self)
|
||||
/*[clinic end generated code: output=43c7a989e6d4253a input=d39210eedec76fed]*/
|
||||
/*[clinic end generated code: output=43c7a989e6d4253a input=b1bdb306c3798ad4]*/
|
||||
{
|
||||
return Py_BuildValue("Oi", self, DICT_TYPE_UNDIGESTED);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
@getter
|
||||
_zstd.ZstdDict.as_prefix
|
||||
|
||||
|
|
@ -215,7 +219,7 @@ compress(dat, zstd_dict=zd.as_prefix)
|
|||
|
||||
static PyObject *
|
||||
_zstd_ZstdDict_as_prefix_get_impl(ZstdDict *self)
|
||||
/*[clinic end generated code: output=6f7130c356595a16 input=45b3b6110f36d127]*/
|
||||
/*[clinic end generated code: output=6f7130c356595a16 input=77966c012d15e6ab]*/
|
||||
{
|
||||
return Py_BuildValue("Oi", self, DICT_TYPE_PREFIX);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1374,6 +1374,7 @@ array_array_insert_impl(arrayobject *self, Py_ssize_t i, PyObject *v)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
array.array.buffer_info
|
||||
|
||||
Return a tuple (address, length) giving the current memory address and the length in items of the buffer used to hold array's contents.
|
||||
|
|
@ -1384,7 +1385,7 @@ the buffer length in bytes.
|
|||
|
||||
static PyObject *
|
||||
array_array_buffer_info_impl(arrayobject *self)
|
||||
/*[clinic end generated code: output=9b2a4ec3ae7e98e7 input=a58bae5c6e1ac6a6]*/
|
||||
/*[clinic end generated code: output=9b2a4ec3ae7e98e7 input=63d9ad83ba60cda8]*/
|
||||
{
|
||||
PyObject *retval = NULL, *v;
|
||||
|
||||
|
|
@ -1426,6 +1427,7 @@ array_array_append_impl(arrayobject *self, PyObject *v)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
array.array.byteswap
|
||||
|
||||
Byteswap all items of the array.
|
||||
|
|
@ -1436,7 +1438,7 @@ raised.
|
|||
|
||||
static PyObject *
|
||||
array_array_byteswap_impl(arrayobject *self)
|
||||
/*[clinic end generated code: output=5f8236cbdf0d90b5 input=6a85591b950a0186]*/
|
||||
/*[clinic end generated code: output=5f8236cbdf0d90b5 input=9af1d1749000b14f]*/
|
||||
{
|
||||
char *p;
|
||||
Py_ssize_t i;
|
||||
|
|
@ -1519,6 +1521,7 @@ array_array_reverse_impl(arrayobject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
array.array.fromfile
|
||||
|
||||
cls: defining_class
|
||||
|
|
@ -1532,7 +1535,7 @@ Read n objects from the file object f and append them to the end of the array.
|
|||
static PyObject *
|
||||
array_array_fromfile_impl(arrayobject *self, PyTypeObject *cls, PyObject *f,
|
||||
Py_ssize_t n)
|
||||
/*[clinic end generated code: output=83a667080b345ebc input=3822e907c1c11f1a]*/
|
||||
/*[clinic end generated code: output=83a667080b345ebc input=b2b4bdfb7ad4d4ae]*/
|
||||
{
|
||||
PyObject *b, *res;
|
||||
Py_ssize_t itemsize = self->ob_descr->itemsize;
|
||||
|
|
@ -1739,6 +1742,7 @@ frombytes(arrayobject *self, Py_buffer *buffer)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
array.array.frombytes
|
||||
|
||||
buffer: Py_buffer
|
||||
|
|
@ -1749,12 +1753,13 @@ Appends items from the string, interpreting it as an array of machine values, as
|
|||
|
||||
static PyObject *
|
||||
array_array_frombytes_impl(arrayobject *self, Py_buffer *buffer)
|
||||
/*[clinic end generated code: output=d9842c8f7510a516 input=378db226dfac949e]*/
|
||||
/*[clinic end generated code: output=d9842c8f7510a516 input=6b90ce5895f677a4]*/
|
||||
{
|
||||
return frombytes(self, buffer);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
array.array.tobytes
|
||||
|
||||
Convert the array to an array of machine values and return the bytes representation.
|
||||
|
|
@ -1762,7 +1767,7 @@ Convert the array to an array of machine values and return the bytes representat
|
|||
|
||||
static PyObject *
|
||||
array_array_tobytes_impl(arrayobject *self)
|
||||
/*[clinic end generated code: output=87318e4edcdc2bb6 input=90ee495f96de34f5]*/
|
||||
/*[clinic end generated code: output=87318e4edcdc2bb6 input=41081256b97f9d7a]*/
|
||||
{
|
||||
if (Py_SIZE(self) <= PY_SSIZE_T_MAX / self->ob_descr->itemsize) {
|
||||
return PyBytes_FromStringAndSize(self->ob_item,
|
||||
|
|
@ -1773,6 +1778,7 @@ array_array_tobytes_impl(arrayobject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
array.array.fromunicode
|
||||
|
||||
ustr: unicode
|
||||
|
|
@ -1787,7 +1793,7 @@ some other type.
|
|||
|
||||
static PyObject *
|
||||
array_array_fromunicode_impl(arrayobject *self, PyObject *ustr)
|
||||
/*[clinic end generated code: output=24359f5e001a7f2b input=025db1fdade7a4ce]*/
|
||||
/*[clinic end generated code: output=24359f5e001a7f2b input=158d47c302f27ca1]*/
|
||||
{
|
||||
int typecode = self->ob_descr->typecode;
|
||||
if (typecode != 'u' && typecode != 'w') {
|
||||
|
|
@ -1835,6 +1841,7 @@ array_array_fromunicode_impl(arrayobject *self, PyObject *ustr)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
array.array.tounicode
|
||||
|
||||
Extends this array with data from the unicode string ustr.
|
||||
|
|
@ -1846,7 +1853,7 @@ unicode string from an array of some other type.
|
|||
|
||||
static PyObject *
|
||||
array_array_tounicode_impl(arrayobject *self)
|
||||
/*[clinic end generated code: output=08e442378336e1ef input=127242eebe70b66d]*/
|
||||
/*[clinic end generated code: output=08e442378336e1ef input=6690997213d219db]*/
|
||||
{
|
||||
int typecode = self->ob_descr->typecode;
|
||||
if (typecode != 'u' && typecode != 'w') {
|
||||
|
|
|
|||
|
|
@ -360,6 +360,7 @@ binascii_b2a_uu_impl(PyObject *module, Py_buffer *data, int backtick)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
binascii.a2b_base64
|
||||
|
||||
data: ascii_buffer
|
||||
|
|
@ -376,7 +377,7 @@ Decode a line of base64 data.
|
|||
|
||||
static PyObject *
|
||||
binascii_a2b_base64_impl(PyObject *module, Py_buffer *data, int strict_mode)
|
||||
/*[clinic end generated code: output=5409557788d4f975 input=c0c15fd0f8f9a62d]*/
|
||||
/*[clinic end generated code: output=5409557788d4f975 input=13c797187acc9c40]*/
|
||||
{
|
||||
assert(data->len >= 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -590,6 +590,7 @@ errorexit:
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_multibytecodec.MultibyteCodec.encode
|
||||
|
||||
input: object
|
||||
|
|
@ -607,7 +608,7 @@ static PyObject *
|
|||
_multibytecodec_MultibyteCodec_encode_impl(MultibyteCodecObject *self,
|
||||
PyObject *input,
|
||||
const char *errors)
|
||||
/*[clinic end generated code: output=7b26652045ba56a9 input=2841745b95ed338f]*/
|
||||
/*[clinic end generated code: output=7b26652045ba56a9 input=0980aede2c564df8]*/
|
||||
{
|
||||
MultibyteCodec_State state;
|
||||
PyObject *errorcb, *r, *ucvt;
|
||||
|
|
@ -655,6 +656,7 @@ errorexit:
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_multibytecodec.MultibyteCodec.decode
|
||||
|
||||
input: Py_buffer
|
||||
|
|
@ -672,7 +674,7 @@ static PyObject *
|
|||
_multibytecodec_MultibyteCodec_decode_impl(MultibyteCodecObject *self,
|
||||
Py_buffer *input,
|
||||
const char *errors)
|
||||
/*[clinic end generated code: output=ff419f65bad6cc77 input=e0c78fc7ab190def]*/
|
||||
/*[clinic end generated code: output=ff419f65bad6cc77 input=2c657ef914600c7c]*/
|
||||
{
|
||||
MultibyteCodec_State state;
|
||||
MultibyteDecodeBuffer buf;
|
||||
|
|
|
|||
|
|
@ -1035,6 +1035,7 @@ cmath_rect_impl(PyObject *module, double r, double phi)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
cmath.isfinite = cmath.polar
|
||||
|
||||
Return True if both the real and imaginary parts of z are finite, else False.
|
||||
|
|
@ -1042,7 +1043,7 @@ Return True if both the real and imaginary parts of z are finite, else False.
|
|||
|
||||
static PyObject *
|
||||
cmath_isfinite_impl(PyObject *module, Py_complex z)
|
||||
/*[clinic end generated code: output=ac76611e2c774a36 input=848e7ee701895815]*/
|
||||
/*[clinic end generated code: output=ac76611e2c774a36 input=e224f5c36d94f5da]*/
|
||||
{
|
||||
return PyBool_FromLong(isfinite(z.real) && isfinite(z.imag));
|
||||
}
|
||||
|
|
@ -1074,6 +1075,7 @@ cmath_isinf_impl(PyObject *module, Py_complex z)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
cmath.isclose -> bool
|
||||
|
||||
a: Py_complex
|
||||
|
|
@ -1100,7 +1102,7 @@ not close to anything, even itself. inf and -inf are only close to themselves.
|
|||
static int
|
||||
cmath_isclose_impl(PyObject *module, Py_complex a, Py_complex b,
|
||||
double rel_tol, double abs_tol)
|
||||
/*[clinic end generated code: output=8a2486cc6e0014d1 input=df9636d7de1d4ac3]*/
|
||||
/*[clinic end generated code: output=8a2486cc6e0014d1 input=0d45feea7c626f47]*/
|
||||
{
|
||||
double diff;
|
||||
|
||||
|
|
|
|||
|
|
@ -152,6 +152,7 @@ fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg)
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
fcntl.ioctl
|
||||
|
||||
fd: fildes
|
||||
|
|
@ -193,7 +194,7 @@ code.
|
|||
static PyObject *
|
||||
fcntl_ioctl_impl(PyObject *module, int fd, unsigned long code, PyObject *arg,
|
||||
int mutate_arg)
|
||||
/*[clinic end generated code: output=f72baba2454d7a62 input=9c6cca5e2c339622]*/
|
||||
/*[clinic end generated code: output=f72baba2454d7a62 input=d7fe504d335449e2]*/
|
||||
{
|
||||
/* We use the unsigned non-checked 'I' format for the 'code' parameter
|
||||
because the system expects it to be a 32bit bit field value
|
||||
|
|
@ -400,6 +401,7 @@ fcntl_flock_impl(PyObject *module, int fd, int code)
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
fcntl.lockf
|
||||
|
||||
fd: fildes
|
||||
|
|
@ -436,7 +438,7 @@ starts. `whence` is as with fileobj.seek(), specifically:
|
|||
static PyObject *
|
||||
fcntl_lockf_impl(PyObject *module, int fd, int code, PyObject *lenobj,
|
||||
PyObject *startobj, int whence)
|
||||
/*[clinic end generated code: output=4985e7a172e7461a input=5480479fc63a04b8]*/
|
||||
/*[clinic end generated code: output=4985e7a172e7461a input=f666662ec2edd775]*/
|
||||
{
|
||||
int ret;
|
||||
int async_err = 0;
|
||||
|
|
|
|||
|
|
@ -296,6 +296,7 @@ gc_get_referents_impl(PyObject *module, PyObject *objs)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
gc.get_objects
|
||||
generation: Py_ssize_t(accept={int, NoneType}, c_default="-1") = None
|
||||
Generation to extract the objects from.
|
||||
|
|
@ -308,7 +309,7 @@ that are in that generation.
|
|||
|
||||
static PyObject *
|
||||
gc_get_objects_impl(PyObject *module, Py_ssize_t generation)
|
||||
/*[clinic end generated code: output=48b35fea4ba6cb0e input=ef7da9df9806754c]*/
|
||||
/*[clinic end generated code: output=48b35fea4ba6cb0e input=a887f1d9924be7cf]*/
|
||||
{
|
||||
if (PySys_Audit("gc.get_objects", "n", generation) < 0) {
|
||||
return NULL;
|
||||
|
|
@ -414,6 +415,7 @@ gc_is_finalized_impl(PyObject *module, PyObject *obj)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
gc.freeze
|
||||
|
||||
Freeze all current tracked objects and ignore them for future collections.
|
||||
|
|
@ -425,7 +427,7 @@ which can cause copy-on-write.
|
|||
|
||||
static PyObject *
|
||||
gc_freeze_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=502159d9cdc4c139 input=b602b16ac5febbe5]*/
|
||||
/*[clinic end generated code: output=502159d9cdc4c139 input=11fb59b0a75dcf3d]*/
|
||||
{
|
||||
PyInterpreterState *interp = _PyInterpreterState_GET();
|
||||
_PyGC_Freeze(interp);
|
||||
|
|
|
|||
|
|
@ -943,6 +943,8 @@ _hmac_HMAC_digest_impl(HMACObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
_hmac.HMAC.hexdigest
|
||||
|
||||
Return hexadecimal digest of the bytes passed to the update() method so far.
|
||||
|
|
@ -955,7 +957,7 @@ This method may raise a MemoryError.
|
|||
|
||||
static PyObject *
|
||||
_hmac_HMAC_hexdigest_impl(HMACObject *self)
|
||||
/*[clinic end generated code: output=6659807a09ae14ec input=493b2db8013982b9]*/
|
||||
/*[clinic end generated code: output=6659807a09ae14ec input=6e0e796e38d82fc8]*/
|
||||
{
|
||||
assert(self->digest_size <= Py_hmac_hash_max_digest_size);
|
||||
uint8_t digest[Py_hmac_hash_max_digest_size];
|
||||
|
|
|
|||
|
|
@ -1129,6 +1129,7 @@ typedef struct {
|
|||
#define cycleobject_CAST(op) ((cycleobject *)(op))
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@classmethod
|
||||
itertools.cycle.__new__
|
||||
iterable: object
|
||||
|
|
@ -1138,7 +1139,7 @@ Return elements from the iterable until it is exhausted. Then repeat the sequenc
|
|||
|
||||
static PyObject *
|
||||
itertools_cycle_impl(PyTypeObject *type, PyObject *iterable)
|
||||
/*[clinic end generated code: output=f60e5ec17a45b35c input=9d1d84bcf66e908b]*/
|
||||
/*[clinic end generated code: output=f60e5ec17a45b35c input=ead392f4aac7afd8]*/
|
||||
{
|
||||
PyObject *it;
|
||||
PyObject *saved;
|
||||
|
|
@ -1386,6 +1387,7 @@ typedef struct {
|
|||
#define takewhileobject_CAST(op) ((takewhileobject *)(op))
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@classmethod
|
||||
itertools.takewhile.__new__
|
||||
predicate as func: object
|
||||
|
|
@ -1396,7 +1398,7 @@ Return successive entries from an iterable as long as the predicate evaluates to
|
|||
|
||||
static PyObject *
|
||||
itertools_takewhile_impl(PyTypeObject *type, PyObject *func, PyObject *seq)
|
||||
/*[clinic end generated code: output=bb179ea7864e2ef6 input=ba5255f7519aa119]*/
|
||||
/*[clinic end generated code: output=bb179ea7864e2ef6 input=61e42255dd0a7657]*/
|
||||
{
|
||||
PyObject *it;
|
||||
takewhileobject *lz;
|
||||
|
|
@ -1695,6 +1697,7 @@ typedef struct {
|
|||
#define starmapobject_CAST(op) ((starmapobject *)(op))
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@classmethod
|
||||
itertools.starmap.__new__
|
||||
function as func: object
|
||||
|
|
@ -1705,7 +1708,7 @@ Return an iterator whose values are returned from the function evaluated with an
|
|||
|
||||
static PyObject *
|
||||
itertools_starmap_impl(PyTypeObject *type, PyObject *func, PyObject *seq)
|
||||
/*[clinic end generated code: output=79eeb81d452c6e8d input=844766df6a0d4dad]*/
|
||||
/*[clinic end generated code: output=79eeb81d452c6e8d input=8c9068da0692d6d2]*/
|
||||
{
|
||||
PyObject *it;
|
||||
starmapobject *lz;
|
||||
|
|
@ -1838,6 +1841,7 @@ chain_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@classmethod
|
||||
itertools.chain.from_iterable
|
||||
iterable as arg: object
|
||||
|
|
@ -1847,7 +1851,7 @@ Alternative chain() constructor taking a single iterable argument that evaluates
|
|||
|
||||
static PyObject *
|
||||
itertools_chain_from_iterable_impl(PyTypeObject *type, PyObject *arg)
|
||||
/*[clinic end generated code: output=3d7ea7d46b9e43f5 input=72c39e3a2ca3be85]*/
|
||||
/*[clinic end generated code: output=3d7ea7d46b9e43f5 input=a9bf8227221c75b3]*/
|
||||
{
|
||||
PyObject *source;
|
||||
|
||||
|
|
@ -2501,6 +2505,8 @@ typedef struct {
|
|||
#define cwrobject_CAST(op) ((cwrobject *)(op))
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
@classmethod
|
||||
itertools.combinations_with_replacement.__new__
|
||||
iterable: object
|
||||
|
|
@ -2514,7 +2520,7 @@ static PyObject *
|
|||
itertools_combinations_with_replacement_impl(PyTypeObject *type,
|
||||
PyObject *iterable,
|
||||
Py_ssize_t r)
|
||||
/*[clinic end generated code: output=48b26856d4e659ca input=1dc58e82a0878fdc]*/
|
||||
/*[clinic end generated code: output=48b26856d4e659ca input=26ebe0e42149e9fb]*/
|
||||
{
|
||||
cwrobject *co;
|
||||
Py_ssize_t n;
|
||||
|
|
|
|||
|
|
@ -3806,6 +3806,7 @@ error:
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
math.perm
|
||||
|
||||
n: object
|
||||
|
|
@ -3826,7 +3827,7 @@ Raises ValueError if either of the arguments are negative.
|
|||
|
||||
static PyObject *
|
||||
math_perm_impl(PyObject *module, PyObject *n, PyObject *k)
|
||||
/*[clinic end generated code: output=e021a25469653e23 input=5311c5a00f359b53]*/
|
||||
/*[clinic end generated code: output=e021a25469653e23 input=9d54b8e13c0a3683]*/
|
||||
{
|
||||
PyObject *result = NULL;
|
||||
int overflow, cmp;
|
||||
|
|
@ -3899,6 +3900,7 @@ error:
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
math.comb
|
||||
|
||||
n: object
|
||||
|
|
@ -3921,7 +3923,7 @@ Raises ValueError if either of the arguments are negative.
|
|||
|
||||
static PyObject *
|
||||
math_comb_impl(PyObject *module, PyObject *n, PyObject *k)
|
||||
/*[clinic end generated code: output=bd2cec8d854f3493 input=9a05315af2518709]*/
|
||||
/*[clinic end generated code: output=bd2cec8d854f3493 input=7ad3c763d442d64c]*/
|
||||
{
|
||||
PyObject *result = NULL, *temp;
|
||||
int overflow, cmp;
|
||||
|
|
@ -4018,6 +4020,7 @@ error:
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
math.nextafter
|
||||
|
||||
x: double
|
||||
|
|
@ -4036,7 +4039,7 @@ Raises ValueError if steps is negative.
|
|||
|
||||
static PyObject *
|
||||
math_nextafter_impl(PyObject *module, double x, double y, PyObject *steps)
|
||||
/*[clinic end generated code: output=cc6511f02afc099e input=7f2a5842112af2b4]*/
|
||||
/*[clinic end generated code: output=cc6511f02afc099e input=cc8f0dad1b27a8a4]*/
|
||||
{
|
||||
#if defined(_AIX)
|
||||
if (x == y) {
|
||||
|
|
|
|||
|
|
@ -3238,6 +3238,7 @@ os_stat_impl(PyObject *module, path_t *path, int dir_fd, int follow_symlinks)
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
os.lstat
|
||||
|
||||
path : path_t
|
||||
|
|
@ -3254,7 +3255,7 @@ Equivalent to stat(path, follow_symlinks=False).
|
|||
|
||||
static PyObject *
|
||||
os_lstat_impl(PyObject *module, path_t *path, int dir_fd)
|
||||
/*[clinic end generated code: output=ef82a5d35ce8ab37 input=0b7474765927b925]*/
|
||||
/*[clinic end generated code: output=ef82a5d35ce8ab37 input=024102124f88e743]*/
|
||||
{
|
||||
int follow_symlinks = 0;
|
||||
return posix_do_stat(module, "lstat", path, dir_fd, follow_symlinks);
|
||||
|
|
@ -4344,6 +4345,7 @@ os_getcwdb_impl(PyObject *module)
|
|||
#ifdef HAVE_LINK
|
||||
/*[clinic input]
|
||||
|
||||
@permit_long_docstring_body
|
||||
os.link
|
||||
|
||||
src : path_t
|
||||
|
|
@ -4369,7 +4371,7 @@ src_dir_fd, dst_dir_fd, and follow_symlinks may not be implemented on your
|
|||
static PyObject *
|
||||
os_link_impl(PyObject *module, path_t *src, path_t *dst, int src_dir_fd,
|
||||
int dst_dir_fd, int follow_symlinks)
|
||||
/*[clinic end generated code: output=7f00f6007fd5269a input=1d5e602d115fed7b]*/
|
||||
/*[clinic end generated code: output=7f00f6007fd5269a input=e2a50a6497050e44]*/
|
||||
{
|
||||
#ifdef MS_WINDOWS
|
||||
BOOL result = FALSE;
|
||||
|
|
@ -4663,6 +4665,7 @@ exit:
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
os.listdir
|
||||
|
||||
path : path_t(nullable=True, allow_fd='PATH_HAVE_FDOPENDIR') = None
|
||||
|
|
@ -4685,7 +4688,7 @@ entries '.' and '..' even if they are present in the directory.
|
|||
|
||||
static PyObject *
|
||||
os_listdir_impl(PyObject *module, path_t *path)
|
||||
/*[clinic end generated code: output=293045673fcd1a75 input=e3f58030f538295d]*/
|
||||
/*[clinic end generated code: output=293045673fcd1a75 input=0bd1728387391b9a]*/
|
||||
{
|
||||
if (PySys_Audit("os.listdir", "O",
|
||||
path->object ? path->object : Py_None) < 0) {
|
||||
|
|
@ -5975,6 +5978,7 @@ internal_rename(path_t *src, path_t *dst, int src_dir_fd, int dst_dir_fd, int is
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
os.rename
|
||||
|
||||
src : path_t
|
||||
|
|
@ -5995,13 +5999,14 @@ src_dir_fd and dst_dir_fd, may not be implemented on your platform.
|
|||
static PyObject *
|
||||
os_rename_impl(PyObject *module, path_t *src, path_t *dst, int src_dir_fd,
|
||||
int dst_dir_fd)
|
||||
/*[clinic end generated code: output=59e803072cf41230 input=faa61c847912c850]*/
|
||||
/*[clinic end generated code: output=59e803072cf41230 input=11aae8c091162766]*/
|
||||
{
|
||||
return internal_rename(src, dst, src_dir_fd, dst_dir_fd, 0);
|
||||
}
|
||||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
os.replace = os.rename
|
||||
|
||||
Rename a file or directory, overwriting the destination.
|
||||
|
|
@ -6016,7 +6021,7 @@ src_dir_fd and dst_dir_fd, may not be implemented on your platform.
|
|||
static PyObject *
|
||||
os_replace_impl(PyObject *module, path_t *src, path_t *dst, int src_dir_fd,
|
||||
int dst_dir_fd)
|
||||
/*[clinic end generated code: output=1968c02e7857422b input=c003f0def43378ef]*/
|
||||
/*[clinic end generated code: output=1968c02e7857422b input=78d6c8087e90994c]*/
|
||||
{
|
||||
return internal_rename(src, dst, src_dir_fd, dst_dir_fd, 1);
|
||||
}
|
||||
|
|
@ -8432,6 +8437,7 @@ os_sched_setparam_impl(PyObject *module, pid_t pid, PyObject *param_obj)
|
|||
|
||||
#ifdef HAVE_SCHED_RR_GET_INTERVAL
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
os.sched_rr_get_interval -> double
|
||||
pid: pid_t
|
||||
/
|
||||
|
|
@ -8443,7 +8449,7 @@ Value returned is a float.
|
|||
|
||||
static double
|
||||
os_sched_rr_get_interval_impl(PyObject *module, pid_t pid)
|
||||
/*[clinic end generated code: output=7e2d935833ab47dc input=2a973da15cca6fae]*/
|
||||
/*[clinic end generated code: output=7e2d935833ab47dc input=cab0b83586776b10]*/
|
||||
{
|
||||
struct timespec interval;
|
||||
if (sched_rr_get_interval(pid, &interval)) {
|
||||
|
|
@ -8583,6 +8589,7 @@ error:
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
os.sched_getaffinity
|
||||
pid: pid_t
|
||||
/
|
||||
|
|
@ -8594,7 +8601,7 @@ The affinity is returned as a set of CPU identifiers.
|
|||
|
||||
static PyObject *
|
||||
os_sched_getaffinity_impl(PyObject *module, pid_t pid)
|
||||
/*[clinic end generated code: output=f726f2c193c17a4f input=983ce7cb4a565980]*/
|
||||
/*[clinic end generated code: output=f726f2c193c17a4f input=cb79ff13579ef091]*/
|
||||
{
|
||||
int ncpus = NCPUS_START;
|
||||
size_t setsize;
|
||||
|
|
@ -10952,6 +10959,7 @@ os_timerfd_settime_ns_impl(PyObject *module, int fd, int flags,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
os.timerfd_gettime
|
||||
|
||||
fd: fildes
|
||||
|
|
@ -10963,7 +10971,7 @@ Return a tuple of a timer file descriptor's (interval, next expiration) in float
|
|||
|
||||
static PyObject *
|
||||
os_timerfd_gettime_impl(PyObject *module, int fd)
|
||||
/*[clinic end generated code: output=ec5a94a66cfe6ab4 input=8148e3430870da1c]*/
|
||||
/*[clinic end generated code: output=ec5a94a66cfe6ab4 input=05f7d568a4820dc6]*/
|
||||
{
|
||||
struct itimerspec curr_value;
|
||||
int result;
|
||||
|
|
@ -10978,6 +10986,7 @@ os_timerfd_gettime_impl(PyObject *module, int fd)
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
os.timerfd_gettime_ns
|
||||
|
||||
fd: fildes
|
||||
|
|
@ -10989,7 +10998,7 @@ Return a tuple of a timer file descriptor's (interval, next expiration) in nanos
|
|||
|
||||
static PyObject *
|
||||
os_timerfd_gettime_ns_impl(PyObject *module, int fd)
|
||||
/*[clinic end generated code: output=580633a4465f39fe input=a825443e4c6b40ac]*/
|
||||
/*[clinic end generated code: output=580633a4465f39fe input=d0de95b9782179c5]*/
|
||||
{
|
||||
struct itimerspec curr_value;
|
||||
int result;
|
||||
|
|
@ -11414,6 +11423,7 @@ os_lockf_impl(PyObject *module, int fd, int command, Py_off_t length)
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
os.lseek -> Py_off_t
|
||||
|
||||
fd: int
|
||||
|
|
@ -11434,7 +11444,7 @@ The return value is the number of bytes relative to the beginning of the file.
|
|||
|
||||
static Py_off_t
|
||||
os_lseek_impl(PyObject *module, int fd, Py_off_t position, int how)
|
||||
/*[clinic end generated code: output=971e1efb6b30bd2f input=f096e754c5367504]*/
|
||||
/*[clinic end generated code: output=971e1efb6b30bd2f input=4a3de549f07e1c40]*/
|
||||
{
|
||||
Py_off_t result;
|
||||
|
||||
|
|
@ -11503,6 +11513,7 @@ os_read_impl(PyObject *module, int fd, Py_ssize_t length)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
os.readinto -> Py_ssize_t
|
||||
fd: int
|
||||
buffer: Py_buffer(accept={rwbuffer})
|
||||
|
|
@ -11523,7 +11534,7 @@ negative.
|
|||
|
||||
static Py_ssize_t
|
||||
os_readinto_impl(PyObject *module, int fd, Py_buffer *buffer)
|
||||
/*[clinic end generated code: output=8091a3513c683a80 input=d40074d0a68de575]*/
|
||||
/*[clinic end generated code: output=8091a3513c683a80 input=a770382bd3d32f9a]*/
|
||||
{
|
||||
assert(buffer->len >= 0);
|
||||
Py_ssize_t result = _Py_read(fd, buffer->buf, buffer->len);
|
||||
|
|
@ -11656,6 +11667,7 @@ os_readv_impl(PyObject *module, int fd, PyObject *buffers)
|
|||
|
||||
#ifdef HAVE_PREAD
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
os.pread
|
||||
|
||||
fd: int
|
||||
|
|
@ -11671,7 +11683,7 @@ the beginning of the file. The file offset remains unchanged.
|
|||
|
||||
static PyObject *
|
||||
os_pread_impl(PyObject *module, int fd, Py_ssize_t length, Py_off_t offset)
|
||||
/*[clinic end generated code: output=3f875c1eef82e32f input=85cb4a5589627144]*/
|
||||
/*[clinic end generated code: output=3f875c1eef82e32f input=5943beb009d3da04]*/
|
||||
{
|
||||
Py_ssize_t n;
|
||||
int async_err = 0;
|
||||
|
|
@ -11708,6 +11720,7 @@ os_pread_impl(PyObject *module, int fd, Py_ssize_t length, Py_off_t offset)
|
|||
|
||||
#if defined(HAVE_PREADV) || defined (HAVE_PREADV2)
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
os.preadv -> Py_ssize_t
|
||||
|
||||
fd: int
|
||||
|
|
@ -11736,7 +11749,7 @@ Using non-zero flags requires Linux 4.6 or newer.
|
|||
static Py_ssize_t
|
||||
os_preadv_impl(PyObject *module, int fd, PyObject *buffers, Py_off_t offset,
|
||||
int flags)
|
||||
/*[clinic end generated code: output=26fc9c6e58e7ada5 input=4173919dc1f7ed99]*/
|
||||
/*[clinic end generated code: output=26fc9c6e58e7ada5 input=c1f876866fcd9d41]*/
|
||||
{
|
||||
Py_ssize_t cnt, n;
|
||||
int async_err = 0;
|
||||
|
|
@ -12352,6 +12365,8 @@ os_pwrite_impl(PyObject *module, int fd, Py_buffer *buffer, Py_off_t offset)
|
|||
|
||||
#if defined(HAVE_PWRITEV) || defined (HAVE_PWRITEV2)
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
os.pwritev -> Py_ssize_t
|
||||
|
||||
fd: int
|
||||
|
|
@ -12381,7 +12396,7 @@ Using non-zero flags requires Linux 4.7 or newer.
|
|||
static Py_ssize_t
|
||||
os_pwritev_impl(PyObject *module, int fd, PyObject *buffers, Py_off_t offset,
|
||||
int flags)
|
||||
/*[clinic end generated code: output=e3dd3e9d11a6a5c7 input=35358c327e1a2a8e]*/
|
||||
/*[clinic end generated code: output=e3dd3e9d11a6a5c7 input=99d8a21493ff76ca]*/
|
||||
{
|
||||
Py_ssize_t cnt;
|
||||
Py_ssize_t result;
|
||||
|
|
@ -12654,6 +12669,7 @@ os_mkfifo_impl(PyObject *module, path_t *path, int mode, int dir_fd)
|
|||
|
||||
#if defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV)
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
os.mknod
|
||||
|
||||
path: path_t
|
||||
|
|
@ -12680,7 +12696,7 @@ dir_fd may not be implemented on your platform.
|
|||
static PyObject *
|
||||
os_mknod_impl(PyObject *module, path_t *path, int mode, dev_t device,
|
||||
int dir_fd)
|
||||
/*[clinic end generated code: output=92e55d3ca8917461 input=ee44531551a4d83b]*/
|
||||
/*[clinic end generated code: output=92e55d3ca8917461 input=7121c4723d22545b]*/
|
||||
{
|
||||
int result;
|
||||
int async_err = 0;
|
||||
|
|
@ -13271,6 +13287,7 @@ os_WIFSIGNALED_impl(PyObject *module, int status)
|
|||
|
||||
#ifdef WIFEXITED
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
os.WIFEXITED -> bool
|
||||
|
||||
status: int
|
||||
|
|
@ -13280,7 +13297,7 @@ Return True if the process returning status exited via the exit() system call.
|
|||
|
||||
static int
|
||||
os_WIFEXITED_impl(PyObject *module, int status)
|
||||
/*[clinic end generated code: output=01c09d6ebfeea397 input=d63775a6791586c0]*/
|
||||
/*[clinic end generated code: output=01c09d6ebfeea397 input=8c24a82148709b30]*/
|
||||
{
|
||||
WAIT_TYPE wait_status;
|
||||
WAIT_STATUS_INT(wait_status) = status;
|
||||
|
|
@ -13311,6 +13328,7 @@ os_WEXITSTATUS_impl(PyObject *module, int status)
|
|||
|
||||
#ifdef WTERMSIG
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
os.WTERMSIG -> int
|
||||
|
||||
status: int
|
||||
|
|
@ -13320,7 +13338,7 @@ Return the signal that terminated the process that provided the status value.
|
|||
|
||||
static int
|
||||
os_WTERMSIG_impl(PyObject *module, int status)
|
||||
/*[clinic end generated code: output=172f7dfc8dcfc3ad input=727fd7f84ec3f243]*/
|
||||
/*[clinic end generated code: output=172f7dfc8dcfc3ad input=89072f6cbf3f8050]*/
|
||||
{
|
||||
WAIT_TYPE wait_status;
|
||||
WAIT_STATUS_INT(wait_status) = status;
|
||||
|
|
@ -14862,6 +14880,7 @@ os_getresuid_impl(PyObject *module)
|
|||
|
||||
#ifdef HAVE_GETRESGID
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
os.getresgid
|
||||
|
||||
Return a tuple of the current process's real, effective, and saved group ids.
|
||||
|
|
@ -14869,7 +14888,7 @@ Return a tuple of the current process's real, effective, and saved group ids.
|
|||
|
||||
static PyObject *
|
||||
os_getresgid_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=2719c4bfcf27fb9f input=517e68db9ca32df6]*/
|
||||
/*[clinic end generated code: output=2719c4bfcf27fb9f input=ad9adadc86fbdb17]*/
|
||||
{
|
||||
gid_t rgid, egid, sgid;
|
||||
if (getresgid(&rgid, &egid, &sgid) < 0)
|
||||
|
|
@ -14959,6 +14978,7 @@ os_getxattr_impl(PyObject *module, path_t *path, path_t *attribute,
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
os.setxattr
|
||||
|
||||
path: path_t(allow_fd=True)
|
||||
|
|
@ -14980,7 +15000,7 @@ If follow_symlinks is False, and the last element of the path is a symbolic
|
|||
static PyObject *
|
||||
os_setxattr_impl(PyObject *module, path_t *path, path_t *attribute,
|
||||
Py_buffer *value, int flags, int follow_symlinks)
|
||||
/*[clinic end generated code: output=98b83f63fdde26bb input=c17c0103009042f0]*/
|
||||
/*[clinic end generated code: output=98b83f63fdde26bb input=4098e6f68699f3d7]*/
|
||||
{
|
||||
ssize_t result;
|
||||
|
||||
|
|
@ -15062,6 +15082,7 @@ os_removexattr_impl(PyObject *module, path_t *path, path_t *attribute,
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
os.listxattr
|
||||
|
||||
path: path_t(allow_fd=True, nullable=True) = None
|
||||
|
|
@ -15079,7 +15100,7 @@ If follow_symlinks is False, and the last element of the path is a symbolic
|
|||
|
||||
static PyObject *
|
||||
os_listxattr_impl(PyObject *module, path_t *path, int follow_symlinks)
|
||||
/*[clinic end generated code: output=bebdb4e2ad0ce435 input=9826edf9fdb90869]*/
|
||||
/*[clinic end generated code: output=bebdb4e2ad0ce435 input=48aa9ac8be47dea1]*/
|
||||
{
|
||||
Py_ssize_t i;
|
||||
PyObject *result = NULL;
|
||||
|
|
@ -15166,6 +15187,7 @@ exit:
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
os.urandom
|
||||
|
||||
size: Py_ssize_t
|
||||
|
|
@ -15176,7 +15198,7 @@ Return a bytes object containing random bytes suitable for cryptographic use.
|
|||
|
||||
static PyObject *
|
||||
os_urandom_impl(PyObject *module, Py_ssize_t size)
|
||||
/*[clinic end generated code: output=42c5cca9d18068e9 input=4067cdb1b6776c29]*/
|
||||
/*[clinic end generated code: output=42c5cca9d18068e9 input=ade19e6b362e7388]*/
|
||||
{
|
||||
PyObject *bytes;
|
||||
int result;
|
||||
|
|
@ -16624,6 +16646,7 @@ PyOS_FSPath(PyObject *path)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
os.fspath
|
||||
|
||||
path: object
|
||||
|
|
@ -16637,7 +16660,7 @@ types raise a TypeError.
|
|||
|
||||
static PyObject *
|
||||
os_fspath_impl(PyObject *module, PyObject *path)
|
||||
/*[clinic end generated code: output=c3c3b78ecff2914f input=e357165f7b22490f]*/
|
||||
/*[clinic end generated code: output=c3c3b78ecff2914f input=f608743e60a3211e]*/
|
||||
{
|
||||
return PyOS_FSPath(path);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -302,6 +302,7 @@ out:
|
|||
|
||||
#ifdef HAVE_GETPWENT
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
pwd.getpwall
|
||||
|
||||
Return a list of all available password database entries, in arbitrary order.
|
||||
|
|
@ -311,7 +312,7 @@ See help(pwd) for more on password database entries.
|
|||
|
||||
static PyObject *
|
||||
pwd_getpwall_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=4853d2f5a0afac8a input=d7ecebfd90219b85]*/
|
||||
/*[clinic end generated code: output=4853d2f5a0afac8a input=f8145e0d9a79e32c]*/
|
||||
{
|
||||
PyObject *d;
|
||||
struct passwd *p;
|
||||
|
|
|
|||
|
|
@ -767,6 +767,7 @@ pyexpat_xmlparser_SetReparseDeferralEnabled_impl(xmlparseobject *self,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
pyexpat.xmlparser.GetReparseDeferralEnabled
|
||||
|
||||
Retrieve reparse deferral enabled status; always returns false with Expat <2.6.0.
|
||||
|
|
@ -774,7 +775,7 @@ Retrieve reparse deferral enabled status; always returns false with Expat <2.6.0
|
|||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_GetReparseDeferralEnabled_impl(xmlparseobject *self)
|
||||
/*[clinic end generated code: output=4e91312e88a595a8 input=54b5f11d32b20f3e]*/
|
||||
/*[clinic end generated code: output=4e91312e88a595a8 input=ae02d7152ab9e2d0]*/
|
||||
{
|
||||
return PyBool_FromLong(self->reparse_deferral_enabled);
|
||||
}
|
||||
|
|
@ -968,6 +969,7 @@ pyexpat_xmlparser_GetBase_impl(xmlparseobject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
pyexpat.xmlparser.GetInputContext
|
||||
|
||||
Return the untranslated text of the input that caused the current event.
|
||||
|
|
@ -978,7 +980,7 @@ for an element with many attributes), not all of the text may be available.
|
|||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_GetInputContext_impl(xmlparseobject *self)
|
||||
/*[clinic end generated code: output=a88026d683fc22cc input=034df8712db68379]*/
|
||||
/*[clinic end generated code: output=a88026d683fc22cc input=925cea010fdfa682]*/
|
||||
{
|
||||
if (self->in_callback) {
|
||||
int offset, size;
|
||||
|
|
@ -996,6 +998,7 @@ pyexpat_xmlparser_GetInputContext_impl(xmlparseobject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
pyexpat.xmlparser.ExternalEntityParserCreate
|
||||
|
||||
cls: defining_class
|
||||
|
|
@ -1011,7 +1014,7 @@ pyexpat_xmlparser_ExternalEntityParserCreate_impl(xmlparseobject *self,
|
|||
PyTypeObject *cls,
|
||||
const char *context,
|
||||
const char *encoding)
|
||||
/*[clinic end generated code: output=01d4472b49cb3f92 input=ec70c6b9e6e9619a]*/
|
||||
/*[clinic end generated code: output=01d4472b49cb3f92 input=550479eaff952cc0]*/
|
||||
{
|
||||
xmlparseobject *new_parser;
|
||||
pyexpat_state *state = PyType_GetModuleState(cls);
|
||||
|
|
@ -1074,6 +1077,7 @@ pyexpat_xmlparser_ExternalEntityParserCreate_impl(xmlparseobject *self,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
pyexpat.xmlparser.SetParamEntityParsing
|
||||
|
||||
flag: int
|
||||
|
|
@ -1089,7 +1093,7 @@ was successful.
|
|||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_SetParamEntityParsing_impl(xmlparseobject *self, int flag)
|
||||
/*[clinic end generated code: output=18668ee8e760d64c input=8aea19b4b15e9af1]*/
|
||||
/*[clinic end generated code: output=18668ee8e760d64c input=1c43532fcb405879]*/
|
||||
{
|
||||
flag = XML_SetParamEntityParsing(self->itself, flag);
|
||||
return PyLong_FromLong(flag);
|
||||
|
|
@ -1098,6 +1102,8 @@ pyexpat_xmlparser_SetParamEntityParsing_impl(xmlparseobject *self, int flag)
|
|||
|
||||
#if XML_COMBINED_VERSION >= 19505
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
pyexpat.xmlparser.UseForeignDTD
|
||||
|
||||
cls: defining_class
|
||||
|
|
@ -1114,7 +1120,7 @@ information to the parser. 'flag' defaults to True if not provided.
|
|||
static PyObject *
|
||||
pyexpat_xmlparser_UseForeignDTD_impl(xmlparseobject *self, PyTypeObject *cls,
|
||||
int flag)
|
||||
/*[clinic end generated code: output=d7d98252bd25a20f input=23440ecb0573fb29]*/
|
||||
/*[clinic end generated code: output=d7d98252bd25a20f input=c2264845d8c0029c]*/
|
||||
{
|
||||
pyexpat_state *state = PyType_GetModuleState(cls);
|
||||
enum XML_Error rc;
|
||||
|
|
|
|||
|
|
@ -1020,6 +1020,7 @@ readline_insert_text_impl(PyObject *module, PyObject *string)
|
|||
/* Redisplay the line buffer */
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@critical_section
|
||||
readline.redisplay
|
||||
|
||||
|
|
@ -1028,7 +1029,7 @@ Change what's displayed on the screen to reflect contents of the line buffer.
|
|||
|
||||
static PyObject *
|
||||
readline_redisplay_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=a8b9725827c3c34b input=5895fd014615ff58]*/
|
||||
/*[clinic end generated code: output=a8b9725827c3c34b input=fb6ce76959c6f0ec]*/
|
||||
{
|
||||
rl_redisplay();
|
||||
Py_RETURN_NONE;
|
||||
|
|
|
|||
|
|
@ -241,6 +241,7 @@ set2list(fd_set *set, pylist fd2obj[FD_SETSIZE + 1])
|
|||
#endif /* FD_SETSIZE > 1024 */
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
select.select
|
||||
|
||||
rlist: object
|
||||
|
|
@ -276,7 +277,7 @@ descriptors can be used.
|
|||
static PyObject *
|
||||
select_select_impl(PyObject *module, PyObject *rlist, PyObject *wlist,
|
||||
PyObject *xlist, PyObject *timeout_obj)
|
||||
/*[clinic end generated code: output=2b3cfa824f7ae4cf input=1199d5e101abca4a]*/
|
||||
/*[clinic end generated code: output=2b3cfa824f7ae4cf input=df20779a9c2f5c1e]*/
|
||||
{
|
||||
#ifdef SELECT_USES_HEAP
|
||||
pylist *rfd2obj, *wfd2obj, *efd2obj;
|
||||
|
|
@ -1199,6 +1200,7 @@ static PyType_Spec devpoll_Type_spec = {
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
select.poll
|
||||
|
||||
Returns a polling object.
|
||||
|
|
@ -1209,7 +1211,7 @@ polling them for I/O events.
|
|||
|
||||
static PyObject *
|
||||
select_poll_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=16a665a4e1d228c5 input=3f877909d5696bbf]*/
|
||||
/*[clinic end generated code: output=16a665a4e1d228c5 input=5e07eea8ad564e7f]*/
|
||||
{
|
||||
return (PyObject *)newPollObject(module);
|
||||
}
|
||||
|
|
@ -1217,6 +1219,7 @@ select_poll_impl(PyObject *module)
|
|||
#ifdef HAVE_SYS_DEVPOLL_H
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
select.devpoll
|
||||
|
||||
Returns a polling object.
|
||||
|
|
@ -1227,7 +1230,7 @@ polling them for I/O events.
|
|||
|
||||
static PyObject *
|
||||
select_devpoll_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=ea9213cc87fd9581 input=53a1af94564f00a3]*/
|
||||
/*[clinic end generated code: output=ea9213cc87fd9581 input=048506faef19d947]*/
|
||||
{
|
||||
return (PyObject *)newDevPollObject(module);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -460,6 +460,7 @@ signal_raise_signal_impl(PyObject *module, int signalnum)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
signal.signal
|
||||
|
||||
signalnum: int
|
||||
|
|
@ -478,7 +479,7 @@ the first is the signal number, the second is the interrupted stack frame.
|
|||
|
||||
static PyObject *
|
||||
signal_signal_impl(PyObject *module, int signalnum, PyObject *handler)
|
||||
/*[clinic end generated code: output=b44cfda43780f3a1 input=deee84af5fa0432c]*/
|
||||
/*[clinic end generated code: output=b44cfda43780f3a1 input=7608656f34fa378b]*/
|
||||
{
|
||||
_signal_module_state *modstate = get_signal_state(module);
|
||||
PyObject *old_handler;
|
||||
|
|
@ -709,6 +710,7 @@ signal_siginterrupt_impl(PyObject *module, int signalnum, int flag)
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
signal.set_wakeup_fd
|
||||
|
||||
fd as fdobj: object
|
||||
|
|
@ -727,7 +729,7 @@ The fd must be non-blocking.
|
|||
static PyObject *
|
||||
signal_set_wakeup_fd_impl(PyObject *module, PyObject *fdobj,
|
||||
int warn_on_full_buffer)
|
||||
/*[clinic end generated code: output=2280d72dd2a54c4f input=5b545946a28b8339]*/
|
||||
/*[clinic end generated code: output=2280d72dd2a54c4f input=1b914d48079e9274]*/
|
||||
{
|
||||
struct _Py_stat_struct status;
|
||||
#ifdef MS_WINDOWS
|
||||
|
|
@ -847,6 +849,7 @@ PySignal_SetWakeupFd(int fd)
|
|||
|
||||
#ifdef HAVE_SETITIMER
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
signal.setitimer
|
||||
|
||||
which: int
|
||||
|
|
@ -865,7 +868,7 @@ Returns old values as a tuple: (delay, interval).
|
|||
static PyObject *
|
||||
signal_setitimer_impl(PyObject *module, int which, PyObject *seconds,
|
||||
PyObject *interval)
|
||||
/*[clinic end generated code: output=65f9dcbddc35527b input=de43daf194e6f66f]*/
|
||||
/*[clinic end generated code: output=65f9dcbddc35527b input=ab5bf2b8f5cff3f4]*/
|
||||
{
|
||||
_signal_module_state *modstate = get_signal_state(module);
|
||||
|
||||
|
|
|
|||
|
|
@ -4624,6 +4624,7 @@ sock_send_impl(PySocketSockObject *s, void *data)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_socket.socket.send
|
||||
self as s: self(type="PySocketSockObject *")
|
||||
data as pbuf: Py_buffer
|
||||
|
|
@ -4638,7 +4639,7 @@ Return the number of bytes sent; this may be less than len(data) if the network
|
|||
|
||||
static PyObject *
|
||||
_socket_socket_send_impl(PySocketSockObject *s, Py_buffer *pbuf, int flags)
|
||||
/*[clinic end generated code: output=3ddf83f17d0c875b input=befe7d7790ccb035]*/
|
||||
/*[clinic end generated code: output=3ddf83f17d0c875b input=e776a48af2e3d615]*/
|
||||
|
||||
{
|
||||
struct sock_send ctx;
|
||||
|
|
@ -6693,6 +6694,7 @@ _socket_htonl_impl(PyObject *module, uint32_t x)
|
|||
/* socket.inet_aton() and socket.inet_ntoa() functions. */
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_socket.inet_aton
|
||||
ip_addr: str
|
||||
/
|
||||
|
|
@ -6702,7 +6704,7 @@ Convert an IP address in string format (123.45.67.89) to the 32-bit packed binar
|
|||
|
||||
static PyObject *
|
||||
_socket_inet_aton_impl(PyObject *module, const char *ip_addr)
|
||||
/*[clinic end generated code: output=f2c2f772eb721b6e input=3a52dec207bf8956]*/
|
||||
/*[clinic end generated code: output=f2c2f772eb721b6e input=0bd9e5ee400fafd6]*/
|
||||
{
|
||||
#ifdef HAVE_INET_ATON
|
||||
struct in_addr buf;
|
||||
|
|
|
|||
|
|
@ -474,6 +474,7 @@ termios_tcgetwinsize_impl(PyObject *module, int fd)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
termios.tcsetwinsize
|
||||
|
||||
fd: fildes
|
||||
|
|
@ -488,7 +489,7 @@ is a two-item tuple (ws_row, ws_col) like the one returned by tcgetwinsize().
|
|||
|
||||
static PyObject *
|
||||
termios_tcsetwinsize_impl(PyObject *module, int fd, PyObject *winsz)
|
||||
/*[clinic end generated code: output=2ac3c9bb6eda83e1 input=4a06424465b24aee]*/
|
||||
/*[clinic end generated code: output=2ac3c9bb6eda83e1 input=9a163c4e06fc4a41]*/
|
||||
{
|
||||
if (!PySequence_Check(winsz) || PySequence_Size(winsz) != 2) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
|
|
|
|||
|
|
@ -305,6 +305,7 @@ unicodedata_UCD_bidirectional_impl(PyObject *self, int chr)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
unicodedata.UCD.combining -> int
|
||||
|
||||
self: self
|
||||
|
|
@ -318,7 +319,7 @@ Returns 0 if no combining class is defined.
|
|||
|
||||
static int
|
||||
unicodedata_UCD_combining_impl(PyObject *self, int chr)
|
||||
/*[clinic end generated code: output=cad056d0cb6a5920 input=9f2d6b2a95d0a22a]*/
|
||||
/*[clinic end generated code: output=cad056d0cb6a5920 input=e05edfbb882ebfed]*/
|
||||
{
|
||||
int index;
|
||||
Py_UCS4 c = (Py_UCS4)chr;
|
||||
|
|
@ -389,6 +390,7 @@ unicodedata_UCD_east_asian_width_impl(PyObject *self, int chr)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
unicodedata.UCD.decomposition
|
||||
|
||||
self: self
|
||||
|
|
@ -402,7 +404,7 @@ An empty string is returned in case no such mapping is defined.
|
|||
|
||||
static PyObject *
|
||||
unicodedata_UCD_decomposition_impl(PyObject *self, int chr)
|
||||
/*[clinic end generated code: output=7d699f3ec7565d27 input=e4c12459ad68507b]*/
|
||||
/*[clinic end generated code: output=7d699f3ec7565d27 input=84d628d1abfd01ec]*/
|
||||
{
|
||||
char decomp[256];
|
||||
int code, index, count;
|
||||
|
|
|
|||
|
|
@ -862,6 +862,7 @@ save_unconsumed_input(compobject *self, Py_buffer *data, int err)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
zlib.Decompress.decompress
|
||||
|
||||
cls: defining_class
|
||||
|
|
@ -883,7 +884,7 @@ Call the flush() method to clear these buffers.
|
|||
static PyObject *
|
||||
zlib_Decompress_decompress_impl(compobject *self, PyTypeObject *cls,
|
||||
Py_buffer *data, Py_ssize_t max_length)
|
||||
/*[clinic end generated code: output=b024a93c2c922d57 input=bfb37b3864cfb606]*/
|
||||
/*[clinic end generated code: output=b024a93c2c922d57 input=205667f8c387fce4]*/
|
||||
{
|
||||
int err = Z_OK;
|
||||
Py_ssize_t ibuflen;
|
||||
|
|
@ -1668,6 +1669,7 @@ error:
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
zlib.ZlibDecompressor.decompress
|
||||
|
||||
data: Py_buffer
|
||||
|
|
@ -1692,7 +1694,7 @@ the unused_data attribute.
|
|||
static PyObject *
|
||||
zlib_ZlibDecompressor_decompress_impl(ZlibDecompressor *self,
|
||||
Py_buffer *data, Py_ssize_t max_length)
|
||||
/*[clinic end generated code: output=990d32787b775f85 input=0b29d99715250b96]*/
|
||||
/*[clinic end generated code: output=990d32787b775f85 input=fcf9f974de5d02b1]*/
|
||||
|
||||
{
|
||||
PyObject *result = NULL;
|
||||
|
|
|
|||
|
|
@ -1279,6 +1279,7 @@ bytearray_dealloc(PyObject *op)
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@critical_section
|
||||
@text_signature "($self, sub[, start[, end]], /)"
|
||||
bytearray.find
|
||||
|
|
@ -1298,13 +1299,14 @@ Return -1 on failure.
|
|||
static PyObject *
|
||||
bytearray_find_impl(PyByteArrayObject *self, PyObject *sub, Py_ssize_t start,
|
||||
Py_ssize_t end)
|
||||
/*[clinic end generated code: output=413e1cab2ae87da0 input=1de9f4558df68336]*/
|
||||
/*[clinic end generated code: output=413e1cab2ae87da0 input=df3aa94840d893a7]*/
|
||||
{
|
||||
return _Py_bytes_find(PyByteArray_AS_STRING(self), PyByteArray_GET_SIZE(self),
|
||||
sub, start, end);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@critical_section
|
||||
bytearray.count = bytearray.find
|
||||
|
||||
|
|
@ -1314,7 +1316,7 @@ Return the number of non-overlapping occurrences of subsection 'sub' in bytes B[
|
|||
static PyObject *
|
||||
bytearray_count_impl(PyByteArrayObject *self, PyObject *sub,
|
||||
Py_ssize_t start, Py_ssize_t end)
|
||||
/*[clinic end generated code: output=a21ee2692e4f1233 input=2608c30644614724]*/
|
||||
/*[clinic end generated code: output=a21ee2692e4f1233 input=e8fcdca8272857e0]*/
|
||||
{
|
||||
return _Py_bytes_count(PyByteArray_AS_STRING(self), PyByteArray_GET_SIZE(self),
|
||||
sub, start, end);
|
||||
|
|
@ -1351,6 +1353,7 @@ bytearray_copy_impl(PyByteArrayObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@critical_section
|
||||
bytearray.index = bytearray.find
|
||||
|
||||
|
|
@ -1362,13 +1365,14 @@ Raise ValueError if the subsection is not found.
|
|||
static PyObject *
|
||||
bytearray_index_impl(PyByteArrayObject *self, PyObject *sub,
|
||||
Py_ssize_t start, Py_ssize_t end)
|
||||
/*[clinic end generated code: output=067a1e78efc672a7 input=0086ba0ab9bf44a5]*/
|
||||
/*[clinic end generated code: output=067a1e78efc672a7 input=c37f177cfee19fe4]*/
|
||||
{
|
||||
return _Py_bytes_index(PyByteArray_AS_STRING(self), PyByteArray_GET_SIZE(self),
|
||||
sub, start, end);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@critical_section
|
||||
bytearray.rfind = bytearray.find
|
||||
|
||||
|
|
@ -1380,13 +1384,14 @@ Return -1 on failure.
|
|||
static PyObject *
|
||||
bytearray_rfind_impl(PyByteArrayObject *self, PyObject *sub,
|
||||
Py_ssize_t start, Py_ssize_t end)
|
||||
/*[clinic end generated code: output=51bf886f932b283c input=ac73593305d5c1d1]*/
|
||||
/*[clinic end generated code: output=51bf886f932b283c input=1265b11c437d2750]*/
|
||||
{
|
||||
return _Py_bytes_rfind(PyByteArray_AS_STRING(self), PyByteArray_GET_SIZE(self),
|
||||
sub, start, end);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@critical_section
|
||||
bytearray.rindex = bytearray.find
|
||||
|
||||
|
|
@ -1398,7 +1403,7 @@ Raise ValueError if the subsection is not found.
|
|||
static PyObject *
|
||||
bytearray_rindex_impl(PyByteArrayObject *self, PyObject *sub,
|
||||
Py_ssize_t start, Py_ssize_t end)
|
||||
/*[clinic end generated code: output=38e1cf66bafb08b9 input=0cf331bf5ebe0e91]*/
|
||||
/*[clinic end generated code: output=38e1cf66bafb08b9 input=7d198b3d6b0a62ce]*/
|
||||
{
|
||||
return _Py_bytes_rindex(PyByteArray_AS_STRING(self), PyByteArray_GET_SIZE(self),
|
||||
sub, start, end);
|
||||
|
|
@ -1417,6 +1422,7 @@ bytearray_contains(PyObject *self, PyObject *arg)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@critical_section
|
||||
@text_signature "($self, prefix[, start[, end]], /)"
|
||||
bytearray.startswith
|
||||
|
|
@ -1435,13 +1441,14 @@ Return True if the bytearray starts with the specified prefix, False otherwise.
|
|||
static PyObject *
|
||||
bytearray_startswith_impl(PyByteArrayObject *self, PyObject *subobj,
|
||||
Py_ssize_t start, Py_ssize_t end)
|
||||
/*[clinic end generated code: output=a3d9b6d44d3662a6 input=ea8d036d09df34b2]*/
|
||||
/*[clinic end generated code: output=a3d9b6d44d3662a6 input=93f9ffee684f109a]*/
|
||||
{
|
||||
return _Py_bytes_startswith(PyByteArray_AS_STRING(self), PyByteArray_GET_SIZE(self),
|
||||
subobj, start, end);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@critical_section
|
||||
@text_signature "($self, suffix[, start[, end]], /)"
|
||||
bytearray.endswith
|
||||
|
|
@ -1460,7 +1467,7 @@ Return True if the bytearray ends with the specified suffix, False otherwise.
|
|||
static PyObject *
|
||||
bytearray_endswith_impl(PyByteArrayObject *self, PyObject *subobj,
|
||||
Py_ssize_t start, Py_ssize_t end)
|
||||
/*[clinic end generated code: output=e75ea8c227954caa input=c61b90bb23a689ce]*/
|
||||
/*[clinic end generated code: output=e75ea8c227954caa input=d158b030a11d0b06]*/
|
||||
{
|
||||
return _Py_bytes_endswith(PyByteArray_AS_STRING(self), PyByteArray_GET_SIZE(self),
|
||||
subobj, start, end);
|
||||
|
|
@ -1666,6 +1673,8 @@ done:
|
|||
|
||||
/*[clinic input]
|
||||
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
@staticmethod
|
||||
bytearray.maketrans
|
||||
|
||||
|
|
@ -1683,13 +1692,14 @@ The bytes objects frm and to must be of the same length.
|
|||
|
||||
static PyObject *
|
||||
bytearray_maketrans_impl(Py_buffer *frm, Py_buffer *to)
|
||||
/*[clinic end generated code: output=1df267d99f56b15e input=b10de38c85950a63]*/
|
||||
/*[clinic end generated code: output=1df267d99f56b15e input=1146b43a592eca13]*/
|
||||
{
|
||||
return _Py_bytes_maketrans(frm, to);
|
||||
}
|
||||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
@critical_section
|
||||
bytearray.replace
|
||||
|
||||
|
|
@ -1709,7 +1719,7 @@ replaced.
|
|||
static PyObject *
|
||||
bytearray_replace_impl(PyByteArrayObject *self, Py_buffer *old,
|
||||
Py_buffer *new, Py_ssize_t count)
|
||||
/*[clinic end generated code: output=d39884c4dc59412a input=6992755672c8a807]*/
|
||||
/*[clinic end generated code: output=d39884c4dc59412a input=66afec32f4e095e0]*/
|
||||
{
|
||||
return stringlib_replace((PyObject *)self,
|
||||
(const char *)old->buf, old->len,
|
||||
|
|
@ -1717,6 +1727,7 @@ bytearray_replace_impl(PyByteArrayObject *self, Py_buffer *old,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@critical_section
|
||||
bytearray.split
|
||||
|
||||
|
|
@ -1734,7 +1745,7 @@ Return a list of the sections in the bytearray, using sep as the delimiter.
|
|||
static PyObject *
|
||||
bytearray_split_impl(PyByteArrayObject *self, PyObject *sep,
|
||||
Py_ssize_t maxsplit)
|
||||
/*[clinic end generated code: output=833e2cf385d9a04d input=1c367486b9938909]*/
|
||||
/*[clinic end generated code: output=833e2cf385d9a04d input=dd9f6e2910cc3a34]*/
|
||||
{
|
||||
Py_ssize_t len = PyByteArray_GET_SIZE(self), n;
|
||||
const char *s = PyByteArray_AS_STRING(self), *sub;
|
||||
|
|
@ -1760,6 +1771,7 @@ bytearray_split_impl(PyByteArrayObject *self, PyObject *sep,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
@critical_section
|
||||
bytearray.partition
|
||||
|
||||
|
|
@ -1778,7 +1790,7 @@ original bytearray object and two empty bytearray objects.
|
|||
|
||||
static PyObject *
|
||||
bytearray_partition_impl(PyByteArrayObject *self, PyObject *sep)
|
||||
/*[clinic end generated code: output=b5fa1e03f10cfccb input=632855f986733f34]*/
|
||||
/*[clinic end generated code: output=b5fa1e03f10cfccb input=b87276af883f39d9]*/
|
||||
{
|
||||
PyObject *bytesep, *result;
|
||||
|
||||
|
|
@ -1798,6 +1810,7 @@ bytearray_partition_impl(PyByteArrayObject *self, PyObject *sep)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
@critical_section
|
||||
bytearray.rpartition
|
||||
|
||||
|
|
@ -1817,7 +1830,7 @@ objects and the copy of the original bytearray object.
|
|||
|
||||
static PyObject *
|
||||
bytearray_rpartition_impl(PyByteArrayObject *self, PyObject *sep)
|
||||
/*[clinic end generated code: output=0186ce7b1ef61289 input=4318e3d125497450]*/
|
||||
/*[clinic end generated code: output=0186ce7b1ef61289 input=5bdcfc4c333bcfab]*/
|
||||
{
|
||||
PyObject *bytesep, *result;
|
||||
|
||||
|
|
@ -1837,6 +1850,8 @@ bytearray_rpartition_impl(PyByteArrayObject *self, PyObject *sep)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
@critical_section
|
||||
bytearray.rsplit = bytearray.split
|
||||
|
||||
|
|
@ -1848,7 +1863,7 @@ Splitting is done starting at the end of the bytearray and working to the front.
|
|||
static PyObject *
|
||||
bytearray_rsplit_impl(PyByteArrayObject *self, PyObject *sep,
|
||||
Py_ssize_t maxsplit)
|
||||
/*[clinic end generated code: output=a55e0b5a03cb6190 input=3cd513c2b94a53c1]*/
|
||||
/*[clinic end generated code: output=a55e0b5a03cb6190 input=60e9abf305128ff4]*/
|
||||
{
|
||||
Py_ssize_t len = PyByteArray_GET_SIZE(self), n;
|
||||
const char *s = PyByteArray_AS_STRING(self), *sub;
|
||||
|
|
@ -2091,6 +2106,7 @@ bytearray_expandtabs(PyObject *self, PyObject *const *args, Py_ssize_t nargs, Py
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@critical_section
|
||||
bytearray.extend
|
||||
|
||||
|
|
@ -2103,7 +2119,7 @@ Append all the items from the iterator or sequence to the end of the bytearray.
|
|||
|
||||
static PyObject *
|
||||
bytearray_extend_impl(PyByteArrayObject *self, PyObject *iterable_of_ints)
|
||||
/*[clinic end generated code: output=2f25e0ce72b98748 input=86e65beaba444650]*/
|
||||
/*[clinic end generated code: output=2f25e0ce72b98748 input=aeed44b025146632]*/
|
||||
{
|
||||
PyObject *it, *item, *bytearray_obj;
|
||||
Py_ssize_t buf_size = 0, len = 0;
|
||||
|
|
@ -2322,6 +2338,7 @@ bytearray_strip_impl_helper(PyByteArrayObject* self, PyObject* bytes, int stript
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
@critical_section
|
||||
bytearray.strip
|
||||
|
||||
|
|
@ -2335,7 +2352,7 @@ If the argument is omitted or None, strip leading and trailing ASCII whitespace.
|
|||
|
||||
static PyObject *
|
||||
bytearray_strip_impl(PyByteArrayObject *self, PyObject *bytes)
|
||||
/*[clinic end generated code: output=760412661a34ad5a input=1f9026e5ad35388a]*/
|
||||
/*[clinic end generated code: output=760412661a34ad5a input=6acaf88b2ec9daa7]*/
|
||||
{
|
||||
return bytearray_strip_impl_helper(self, bytes, BOTHSTRIP);
|
||||
}
|
||||
|
|
@ -2512,6 +2529,8 @@ bytearray_rjust(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
@critical_section
|
||||
bytearray.splitlines
|
||||
|
||||
|
|
@ -2525,7 +2544,7 @@ true.
|
|||
|
||||
static PyObject *
|
||||
bytearray_splitlines_impl(PyByteArrayObject *self, int keepends)
|
||||
/*[clinic end generated code: output=4223c94b895f6ad9 input=874cd662866a66a1]*/
|
||||
/*[clinic end generated code: output=4223c94b895f6ad9 input=21bc3f02bf1be832]*/
|
||||
{
|
||||
return stringlib_splitlines(
|
||||
(PyObject*) self, PyByteArray_AS_STRING(self),
|
||||
|
|
|
|||
|
|
@ -1786,6 +1786,7 @@ bytes_split_impl(PyBytesObject *self, PyObject *sep, Py_ssize_t maxsplit)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
bytes.partition
|
||||
|
||||
sep: Py_buffer
|
||||
|
|
@ -1803,7 +1804,7 @@ object and two empty bytes objects.
|
|||
|
||||
static PyObject *
|
||||
bytes_partition_impl(PyBytesObject *self, Py_buffer *sep)
|
||||
/*[clinic end generated code: output=f532b392a17ff695 input=61cca95519406099]*/
|
||||
/*[clinic end generated code: output=f532b392a17ff695 input=31c55a0cebaf7722]*/
|
||||
{
|
||||
return stringlib_partition(
|
||||
(PyObject*) self,
|
||||
|
|
@ -1813,6 +1814,7 @@ bytes_partition_impl(PyBytesObject *self, Py_buffer *sep)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
bytes.rpartition
|
||||
|
||||
sep: Py_buffer
|
||||
|
|
@ -1830,7 +1832,7 @@ objects and the original bytes object.
|
|||
|
||||
static PyObject *
|
||||
bytes_rpartition_impl(PyBytesObject *self, Py_buffer *sep)
|
||||
/*[clinic end generated code: output=191b114cbb028e50 input=d78db010c8cfdbe1]*/
|
||||
/*[clinic end generated code: output=191b114cbb028e50 input=9ea5a3ab0b02bf52]*/
|
||||
{
|
||||
return stringlib_rpartition(
|
||||
(PyObject*) self,
|
||||
|
|
@ -1840,6 +1842,7 @@ bytes_rpartition_impl(PyBytesObject *self, Py_buffer *sep)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
bytes.rsplit = bytes.split
|
||||
|
||||
Return a list of the sections in the bytes, using sep as the delimiter.
|
||||
|
|
@ -1849,7 +1852,7 @@ Splitting is done starting at the end of the bytes and working to the front.
|
|||
|
||||
static PyObject *
|
||||
bytes_rsplit_impl(PyBytesObject *self, PyObject *sep, Py_ssize_t maxsplit)
|
||||
/*[clinic end generated code: output=ba698d9ea01e1c8f input=0f86c9f28f7d7b7b]*/
|
||||
/*[clinic end generated code: output=ba698d9ea01e1c8f input=55b6eaea1f3d7046]*/
|
||||
{
|
||||
Py_ssize_t len = PyBytes_GET_SIZE(self), n;
|
||||
const char *s = PyBytes_AS_STRING(self), *sub;
|
||||
|
|
@ -1910,6 +1913,7 @@ PyBytes_Join(PyObject *sep, PyObject *iterable)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@text_signature "($self, sub[, start[, end]], /)"
|
||||
bytes.find
|
||||
|
||||
|
|
@ -1928,13 +1932,14 @@ Return -1 on failure.
|
|||
static PyObject *
|
||||
bytes_find_impl(PyBytesObject *self, PyObject *sub, Py_ssize_t start,
|
||||
Py_ssize_t end)
|
||||
/*[clinic end generated code: output=d5961a1c77b472a1 input=3171e62a8ae7f240]*/
|
||||
/*[clinic end generated code: output=d5961a1c77b472a1 input=47d0929adafc6b0b]*/
|
||||
{
|
||||
return _Py_bytes_find(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self),
|
||||
sub, start, end);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
bytes.index = bytes.find
|
||||
|
||||
Return the lowest index in B where subsection 'sub' is found, such that 'sub' is contained within B[start,end].
|
||||
|
|
@ -1945,13 +1950,14 @@ Raise ValueError if the subsection is not found.
|
|||
static PyObject *
|
||||
bytes_index_impl(PyBytesObject *self, PyObject *sub, Py_ssize_t start,
|
||||
Py_ssize_t end)
|
||||
/*[clinic end generated code: output=0da25cc74683ba42 input=aa34ad71ba0bafe3]*/
|
||||
/*[clinic end generated code: output=0da25cc74683ba42 input=1cb45ce71456a269]*/
|
||||
{
|
||||
return _Py_bytes_index(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self),
|
||||
sub, start, end);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
bytes.rfind = bytes.find
|
||||
|
||||
Return the highest index in B where subsection 'sub' is found, such that 'sub' is contained within B[start,end].
|
||||
|
|
@ -1962,13 +1968,14 @@ Return -1 on failure.
|
|||
static PyObject *
|
||||
bytes_rfind_impl(PyBytesObject *self, PyObject *sub, Py_ssize_t start,
|
||||
Py_ssize_t end)
|
||||
/*[clinic end generated code: output=51b60fa4ad011c09 input=864c3e7f3010b33c]*/
|
||||
/*[clinic end generated code: output=51b60fa4ad011c09 input=c9473d714251f1ab]*/
|
||||
{
|
||||
return _Py_bytes_rfind(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self),
|
||||
sub, start, end);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
bytes.rindex = bytes.find
|
||||
|
||||
Return the highest index in B where subsection 'sub' is found, such that 'sub' is contained within B[start,end].
|
||||
|
|
@ -1979,7 +1986,7 @@ Raise ValueError if the subsection is not found.
|
|||
static PyObject *
|
||||
bytes_rindex_impl(PyBytesObject *self, PyObject *sub, Py_ssize_t start,
|
||||
Py_ssize_t end)
|
||||
/*[clinic end generated code: output=42bf674e0a0aabf6 input=21051fc5cfeacf2c]*/
|
||||
/*[clinic end generated code: output=42bf674e0a0aabf6 input=bb5f473c64610c43]*/
|
||||
{
|
||||
return _Py_bytes_rindex(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self),
|
||||
sub, start, end);
|
||||
|
|
@ -2065,6 +2072,7 @@ do_argstrip(PyBytesObject *self, int striptype, PyObject *bytes)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
bytes.strip
|
||||
|
||||
bytes: object = None
|
||||
|
|
@ -2077,7 +2085,7 @@ If the argument is omitted or None, strip leading and trailing ASCII whitespace.
|
|||
|
||||
static PyObject *
|
||||
bytes_strip_impl(PyBytesObject *self, PyObject *bytes)
|
||||
/*[clinic end generated code: output=c7c228d3bd104a1b input=8a354640e4e0b3ef]*/
|
||||
/*[clinic end generated code: output=c7c228d3bd104a1b input=71904cd278c0ee03]*/
|
||||
{
|
||||
return do_argstrip(self, BOTHSTRIP, bytes);
|
||||
}
|
||||
|
|
@ -2120,6 +2128,7 @@ bytes_rstrip_impl(PyBytesObject *self, PyObject *bytes)
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
bytes.count = bytes.find
|
||||
|
||||
Return the number of non-overlapping occurrences of subsection 'sub' in bytes B[start:end].
|
||||
|
|
@ -2128,7 +2137,7 @@ Return the number of non-overlapping occurrences of subsection 'sub' in bytes B[
|
|||
static PyObject *
|
||||
bytes_count_impl(PyBytesObject *self, PyObject *sub, Py_ssize_t start,
|
||||
Py_ssize_t end)
|
||||
/*[clinic end generated code: output=9848140b9be17d0f input=b6e4a5ed515e1e59]*/
|
||||
/*[clinic end generated code: output=9848140b9be17d0f input=bb2f136f83f0d30e]*/
|
||||
{
|
||||
return _Py_bytes_count(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self),
|
||||
sub, start, end);
|
||||
|
|
@ -2265,6 +2274,8 @@ bytes_translate_impl(PyBytesObject *self, PyObject *table,
|
|||
|
||||
/*[clinic input]
|
||||
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
@staticmethod
|
||||
bytes.maketrans
|
||||
|
||||
|
|
@ -2282,13 +2293,14 @@ The bytes objects frm and to must be of the same length.
|
|||
|
||||
static PyObject *
|
||||
bytes_maketrans_impl(Py_buffer *frm, Py_buffer *to)
|
||||
/*[clinic end generated code: output=a36f6399d4b77f6f input=a3bd00d430a0979f]*/
|
||||
/*[clinic end generated code: output=a36f6399d4b77f6f input=a06b75f44d933fb3]*/
|
||||
{
|
||||
return _Py_bytes_maketrans(frm, to);
|
||||
}
|
||||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
bytes.replace
|
||||
|
||||
old: Py_buffer
|
||||
|
|
@ -2307,7 +2319,7 @@ replaced.
|
|||
static PyObject *
|
||||
bytes_replace_impl(PyBytesObject *self, Py_buffer *old, Py_buffer *new,
|
||||
Py_ssize_t count)
|
||||
/*[clinic end generated code: output=994fa588b6b9c104 input=b2fbbf0bf04de8e5]*/
|
||||
/*[clinic end generated code: output=994fa588b6b9c104 input=8b99a9ab32bc06a2]*/
|
||||
{
|
||||
return stringlib_replace((PyObject *)self,
|
||||
(const char *)old->buf, old->len,
|
||||
|
|
@ -2391,6 +2403,7 @@ bytes_removesuffix_impl(PyBytesObject *self, Py_buffer *suffix)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@text_signature "($self, prefix[, start[, end]], /)"
|
||||
bytes.startswith
|
||||
|
||||
|
|
@ -2408,13 +2421,14 @@ Return True if the bytes starts with the specified prefix, False otherwise.
|
|||
static PyObject *
|
||||
bytes_startswith_impl(PyBytesObject *self, PyObject *subobj,
|
||||
Py_ssize_t start, Py_ssize_t end)
|
||||
/*[clinic end generated code: output=b1e8da1cbd528e8c input=8a4165df8adfa6c9]*/
|
||||
/*[clinic end generated code: output=b1e8da1cbd528e8c input=a14efd070f15be80]*/
|
||||
{
|
||||
return _Py_bytes_startswith(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self),
|
||||
subobj, start, end);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@text_signature "($self, suffix[, start[, end]], /)"
|
||||
bytes.endswith
|
||||
|
||||
|
|
@ -2432,7 +2446,7 @@ Return True if the bytes ends with the specified suffix, False otherwise.
|
|||
static PyObject *
|
||||
bytes_endswith_impl(PyBytesObject *self, PyObject *subobj, Py_ssize_t start,
|
||||
Py_ssize_t end)
|
||||
/*[clinic end generated code: output=038b633111f3629d input=b5c3407a2a5c9aac]*/
|
||||
/*[clinic end generated code: output=038b633111f3629d input=49e383eaaf292713]*/
|
||||
{
|
||||
return _Py_bytes_endswith(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self),
|
||||
subobj, start, end);
|
||||
|
|
@ -2464,6 +2478,7 @@ bytes_decode_impl(PyBytesObject *self, const char *encoding,
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
bytes.splitlines
|
||||
|
||||
keepends: bool = False
|
||||
|
|
@ -2476,7 +2491,7 @@ true.
|
|||
|
||||
static PyObject *
|
||||
bytes_splitlines_impl(PyBytesObject *self, int keepends)
|
||||
/*[clinic end generated code: output=3484149a5d880ffb input=5d7b898af2fe55c0]*/
|
||||
/*[clinic end generated code: output=3484149a5d880ffb input=d17968d2a355fe55]*/
|
||||
{
|
||||
return stringlib_splitlines(
|
||||
(PyObject*) self, PyBytes_AS_STRING(self),
|
||||
|
|
|
|||
|
|
@ -2715,6 +2715,7 @@ code_branchesiterator(PyObject *self, PyObject *Py_UNUSED(args))
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@text_signature "($self, /, **changes)"
|
||||
code.replace
|
||||
|
||||
|
|
@ -2751,7 +2752,7 @@ code_replace_impl(PyCodeObject *self, int co_argcount,
|
|||
PyObject *co_filename, PyObject *co_name,
|
||||
PyObject *co_qualname, PyObject *co_linetable,
|
||||
PyObject *co_exceptiontable)
|
||||
/*[clinic end generated code: output=e75c48a15def18b9 input=a455a89c57ac9d42]*/
|
||||
/*[clinic end generated code: output=e75c48a15def18b9 input=e944fdac8b456114]*/
|
||||
{
|
||||
#define CHECK_INT_ARG(ARG) \
|
||||
if (ARG < 0) { \
|
||||
|
|
|
|||
|
|
@ -869,6 +869,7 @@ Unimplemented:
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
complex.conjugate
|
||||
|
||||
Return the complex conjugate of its argument. (3-4j).conjugate() == 3+4j.
|
||||
|
|
@ -876,7 +877,7 @@ Return the complex conjugate of its argument. (3-4j).conjugate() == 3+4j.
|
|||
|
||||
static PyObject *
|
||||
complex_conjugate_impl(PyComplexObject *self)
|
||||
/*[clinic end generated code: output=5059ef162edfc68e input=5fea33e9747ec2c4]*/
|
||||
/*[clinic end generated code: output=5059ef162edfc68e input=71b8ab003e1cec95]*/
|
||||
{
|
||||
Py_complex c = self->cval;
|
||||
c.imag = -c.imag;
|
||||
|
|
|
|||
|
|
@ -4545,6 +4545,7 @@ dict_clear_impl(PyDictObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
dict.pop
|
||||
|
||||
key: object
|
||||
|
|
@ -4559,7 +4560,7 @@ raise a KeyError.
|
|||
|
||||
static PyObject *
|
||||
dict_pop_impl(PyDictObject *self, PyObject *key, PyObject *default_value)
|
||||
/*[clinic end generated code: output=3abb47b89f24c21c input=e221baa01044c44c]*/
|
||||
/*[clinic end generated code: output=3abb47b89f24c21c input=d409c7eb2de67e38]*/
|
||||
{
|
||||
return dict_pop_default((PyObject*)self, key, default_value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1484,6 +1484,7 @@ float_fromhex_impl(PyTypeObject *type, PyObject *string)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
float.as_integer_ratio
|
||||
|
||||
Return a pair of integers, whose ratio is exactly equal to the original float.
|
||||
|
|
@ -1501,7 +1502,7 @@ OverflowError on infinities and a ValueError on NaNs.
|
|||
|
||||
static PyObject *
|
||||
float_as_integer_ratio_impl(PyObject *self)
|
||||
/*[clinic end generated code: output=65f25f0d8d30a712 input=d5ba7765655d75bd]*/
|
||||
/*[clinic end generated code: output=65f25f0d8d30a712 input=75ae9be7cecd82a3]*/
|
||||
{
|
||||
double self_double;
|
||||
double float_part;
|
||||
|
|
@ -1698,6 +1699,7 @@ typedef enum _py_float_format_type float_format_type;
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
@classmethod
|
||||
float.__getformat__
|
||||
|
||||
|
|
@ -1716,7 +1718,7 @@ C type named by typestr.
|
|||
|
||||
static PyObject *
|
||||
float___getformat___impl(PyTypeObject *type, const char *typestr)
|
||||
/*[clinic end generated code: output=2bfb987228cc9628 input=90d5e246409a246e]*/
|
||||
/*[clinic end generated code: output=2bfb987228cc9628 input=d2735823bfe8e81e]*/
|
||||
{
|
||||
float_format_type r;
|
||||
|
||||
|
|
|
|||
|
|
@ -1849,6 +1849,7 @@ frame_lineno_set_impl(PyFrameObject *self, PyObject *value)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@critical_section
|
||||
@getter
|
||||
frame.f_trace as frame_trace
|
||||
|
|
@ -1858,7 +1859,7 @@ Return the trace function for this frame, or None if no trace function is set.
|
|||
|
||||
static PyObject *
|
||||
frame_trace_get_impl(PyFrameObject *self)
|
||||
/*[clinic end generated code: output=5475cbfce07826cd input=f382612525829773]*/
|
||||
/*[clinic end generated code: output=5475cbfce07826cd input=e4eacf2c68cac577]*/
|
||||
{
|
||||
PyObject* trace = self->f_trace;
|
||||
if (trace == NULL) {
|
||||
|
|
@ -1868,6 +1869,7 @@ frame_trace_get_impl(PyFrameObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@critical_section
|
||||
@setter
|
||||
frame.f_trace as frame_trace
|
||||
|
|
@ -1875,7 +1877,7 @@ frame.f_trace as frame_trace
|
|||
|
||||
static int
|
||||
frame_trace_set_impl(PyFrameObject *self, PyObject *value)
|
||||
/*[clinic end generated code: output=d6fe08335cf76ae4 input=d96a18bda085707f]*/
|
||||
/*[clinic end generated code: output=d6fe08335cf76ae4 input=e57380734815dac5]*/
|
||||
{
|
||||
if (value == Py_None) {
|
||||
value = NULL;
|
||||
|
|
|
|||
|
|
@ -2876,6 +2876,7 @@ unsafe_tuple_compare(PyObject *v, PyObject *w, MergeState *ms)
|
|||
* duplicated).
|
||||
*/
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
@critical_section
|
||||
list.sort
|
||||
|
||||
|
|
@ -2896,7 +2897,7 @@ The reverse flag can be set to sort in descending order.
|
|||
|
||||
static PyObject *
|
||||
list_sort_impl(PyListObject *self, PyObject *keyfunc, int reverse)
|
||||
/*[clinic end generated code: output=57b9f9c5e23fbe42 input=667bf25d0e3a3676]*/
|
||||
/*[clinic end generated code: output=57b9f9c5e23fbe42 input=e4f6b6069181ad7d]*/
|
||||
{
|
||||
MergeState ms;
|
||||
Py_ssize_t nremaining;
|
||||
|
|
|
|||
|
|
@ -6293,6 +6293,7 @@ popcount_digit(digit d)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
int.bit_count
|
||||
|
||||
Number of ones in the binary representation of the absolute value of self.
|
||||
|
|
@ -6307,7 +6308,7 @@ Also known as the population count.
|
|||
|
||||
static PyObject *
|
||||
int_bit_count_impl(PyObject *self)
|
||||
/*[clinic end generated code: output=2e571970daf1e5c3 input=7e0adef8e8ccdf2e]*/
|
||||
/*[clinic end generated code: output=2e571970daf1e5c3 input=f2510a306761db15]*/
|
||||
{
|
||||
assert(self != NULL);
|
||||
assert(PyLong_Check(self));
|
||||
|
|
|
|||
|
|
@ -2265,6 +2265,7 @@ memoryview_tolist_impl(PyMemoryViewObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
memoryview.tobytes
|
||||
|
||||
order: str(accept={str, NoneType}, c_default="NULL") = 'C'
|
||||
|
|
@ -2280,7 +2281,7 @@ to C first. order=None is the same as order='C'.
|
|||
|
||||
static PyObject *
|
||||
memoryview_tobytes_impl(PyMemoryViewObject *self, const char *order)
|
||||
/*[clinic end generated code: output=1288b62560a32a23 input=0efa3ddaeda573a8]*/
|
||||
/*[clinic end generated code: output=1288b62560a32a23 input=23c9faf372cfdbcc]*/
|
||||
{
|
||||
Py_buffer *src = VIEW_ADDR(self);
|
||||
char ord = 'C';
|
||||
|
|
|
|||
|
|
@ -935,6 +935,7 @@ static PyNumberMethods odict_as_number = {
|
|||
/* fromkeys() */
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@classmethod
|
||||
OrderedDict.fromkeys
|
||||
|
||||
|
|
@ -946,7 +947,7 @@ Create a new ordered dictionary with keys from iterable and values set to value.
|
|||
|
||||
static PyObject *
|
||||
OrderedDict_fromkeys_impl(PyTypeObject *type, PyObject *seq, PyObject *value)
|
||||
/*[clinic end generated code: output=c10390d452d78d6d input=1a0476c229c597b3]*/
|
||||
/*[clinic end generated code: output=c10390d452d78d6d input=1277ae0769083848]*/
|
||||
{
|
||||
return _PyDict_FromKeys((PyObject *)type, seq, value);
|
||||
}
|
||||
|
|
@ -1101,6 +1102,7 @@ done:
|
|||
|
||||
/* Skips __missing__() calls. */
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
OrderedDict.pop
|
||||
|
||||
key: object
|
||||
|
|
@ -1115,7 +1117,7 @@ raise a KeyError.
|
|||
static PyObject *
|
||||
OrderedDict_pop_impl(PyODictObject *self, PyObject *key,
|
||||
PyObject *default_value)
|
||||
/*[clinic end generated code: output=7a6447d104e7494b input=7efe36601007dff7]*/
|
||||
/*[clinic end generated code: output=7a6447d104e7494b input=eebd40ac51666d33]*/
|
||||
{
|
||||
Py_hash_t hash = PyObject_Hash(key);
|
||||
if (hash == -1)
|
||||
|
|
|
|||
|
|
@ -1962,6 +1962,7 @@ set_symmetric_difference_update_set(PySetObject *so, PySetObject *other)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
set.symmetric_difference_update
|
||||
so: setobject
|
||||
other: object
|
||||
|
|
@ -1972,7 +1973,7 @@ Update the set, keeping only elements found in either set, but not in both.
|
|||
|
||||
static PyObject *
|
||||
set_symmetric_difference_update_impl(PySetObject *so, PyObject *other)
|
||||
/*[clinic end generated code: output=79f80b4ee5da66c1 input=a50acf0365e1f0a5]*/
|
||||
/*[clinic end generated code: output=79f80b4ee5da66c1 input=86a3dddac9bfb15e]*/
|
||||
{
|
||||
if (Py_Is((PyObject *)so, other)) {
|
||||
return set_clear((PyObject *)so, NULL);
|
||||
|
|
|
|||
|
|
@ -207,6 +207,7 @@ stringlib_center_impl(PyObject *self, Py_ssize_t width, char fillchar)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
B.zfill as stringlib_zfill
|
||||
|
||||
width: Py_ssize_t
|
||||
|
|
@ -219,7 +220,7 @@ The original string is never truncated.
|
|||
|
||||
static PyObject *
|
||||
stringlib_zfill_impl(PyObject *self, Py_ssize_t width)
|
||||
/*[clinic end generated code: output=0b3c684a7f1b2319 input=2da6d7b8e9bcb19a]*/
|
||||
/*[clinic end generated code: output=0b3c684a7f1b2319 input=dfb9cbb16f521756]*/
|
||||
{
|
||||
Py_ssize_t fill;
|
||||
PyObject *s;
|
||||
|
|
|
|||
|
|
@ -11046,6 +11046,7 @@ replace(PyObject *self, PyObject *str1,
|
|||
/* --- Unicode Object Methods --------------------------------------------- */
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
str.title as unicode_title
|
||||
|
||||
Return a version of the string where each word is titlecased.
|
||||
|
|
@ -11056,12 +11057,13 @@ cased characters have lower case.
|
|||
|
||||
static PyObject *
|
||||
unicode_title_impl(PyObject *self)
|
||||
/*[clinic end generated code: output=c75ae03809574902 input=fa945d669b26e683]*/
|
||||
/*[clinic end generated code: output=c75ae03809574902 input=533ce0eb6a7f5d1b]*/
|
||||
{
|
||||
return case_operation(self, do_title);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
str.capitalize as unicode_capitalize
|
||||
|
||||
Return a capitalized version of the string.
|
||||
|
|
@ -11072,7 +11074,7 @@ case.
|
|||
|
||||
static PyObject *
|
||||
unicode_capitalize_impl(PyObject *self)
|
||||
/*[clinic end generated code: output=e49a4c333cdb7667 input=f4cbf1016938da6d]*/
|
||||
/*[clinic end generated code: output=e49a4c333cdb7667 input=a4a15ade41f6f9e9]*/
|
||||
{
|
||||
if (PyUnicode_GET_LENGTH(self) == 0)
|
||||
return unicode_result_unchanged(self);
|
||||
|
|
@ -11720,6 +11722,7 @@ PyUnicode_AppendAndDel(PyObject **pleft, PyObject *right)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@text_signature "($self, sub[, start[, end]], /)"
|
||||
str.count as unicode_count -> Py_ssize_t
|
||||
|
||||
|
|
@ -11737,7 +11740,7 @@ Optional arguments start and end are interpreted as in slice notation.
|
|||
static Py_ssize_t
|
||||
unicode_count_impl(PyObject *str, PyObject *substr, Py_ssize_t start,
|
||||
Py_ssize_t end)
|
||||
/*[clinic end generated code: output=8fcc3aef0b18edbf input=6f168ffd94be8785]*/
|
||||
/*[clinic end generated code: output=8fcc3aef0b18edbf input=8590716ee228b935]*/
|
||||
{
|
||||
assert(PyUnicode_Check(str));
|
||||
assert(PyUnicode_Check(substr));
|
||||
|
|
@ -11911,6 +11914,7 @@ unicode_expandtabs_impl(PyObject *self, int tabsize)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
str.find as unicode_find = str.count
|
||||
|
||||
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].
|
||||
|
|
@ -11922,7 +11926,7 @@ Return -1 on failure.
|
|||
static Py_ssize_t
|
||||
unicode_find_impl(PyObject *str, PyObject *substr, Py_ssize_t start,
|
||||
Py_ssize_t end)
|
||||
/*[clinic end generated code: output=51dbe6255712e278 input=4a89d2d68ef57256]*/
|
||||
/*[clinic end generated code: output=51dbe6255712e278 input=3a9d650fe4c24695]*/
|
||||
{
|
||||
Py_ssize_t result = any_find_slice(str, substr, start, end, 1);
|
||||
if (result < 0) {
|
||||
|
|
@ -11974,6 +11978,7 @@ unicode_hash(PyObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
str.index as unicode_index = str.count
|
||||
|
||||
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].
|
||||
|
|
@ -11985,7 +11990,7 @@ Raises ValueError when the substring is not found.
|
|||
static Py_ssize_t
|
||||
unicode_index_impl(PyObject *str, PyObject *substr, Py_ssize_t start,
|
||||
Py_ssize_t end)
|
||||
/*[clinic end generated code: output=77558288837cdf40 input=d986aeac0be14a1c]*/
|
||||
/*[clinic end generated code: output=77558288837cdf40 input=ae5e48f69ed75b06]*/
|
||||
{
|
||||
Py_ssize_t result = any_find_slice(str, substr, start, end, 1);
|
||||
if (result == -1) {
|
||||
|
|
@ -12014,6 +12019,7 @@ unicode_isascii_impl(PyObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
str.islower as unicode_islower
|
||||
|
||||
Return True if the string is a lowercase string, False otherwise.
|
||||
|
|
@ -12024,7 +12030,7 @@ there is at least one cased character in the string.
|
|||
|
||||
static PyObject *
|
||||
unicode_islower_impl(PyObject *self)
|
||||
/*[clinic end generated code: output=dbd41995bd005b81 input=acec65ac6821ae47]*/
|
||||
/*[clinic end generated code: output=dbd41995bd005b81 input=c6fc0295241a1aaa]*/
|
||||
{
|
||||
Py_ssize_t i, length;
|
||||
int kind;
|
||||
|
|
@ -12057,6 +12063,7 @@ unicode_islower_impl(PyObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
str.isupper as unicode_isupper
|
||||
|
||||
Return True if the string is an uppercase string, False otherwise.
|
||||
|
|
@ -12067,7 +12074,7 @@ there is at least one cased character in the string.
|
|||
|
||||
static PyObject *
|
||||
unicode_isupper_impl(PyObject *self)
|
||||
/*[clinic end generated code: output=049209c8e7f15f59 input=e9b1feda5d17f2d3]*/
|
||||
/*[clinic end generated code: output=049209c8e7f15f59 input=8d5cb33e67efde72]*/
|
||||
{
|
||||
Py_ssize_t i, length;
|
||||
int kind;
|
||||
|
|
@ -12156,6 +12163,7 @@ unicode_istitle_impl(PyObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
str.isspace as unicode_isspace
|
||||
|
||||
Return True if the string is a whitespace string, False otherwise.
|
||||
|
|
@ -12166,7 +12174,7 @@ is at least one character in the string.
|
|||
|
||||
static PyObject *
|
||||
unicode_isspace_impl(PyObject *self)
|
||||
/*[clinic end generated code: output=163a63bfa08ac2b9 input=fe462cb74f8437d8]*/
|
||||
/*[clinic end generated code: output=163a63bfa08ac2b9 input=44fe05e248c6e159]*/
|
||||
{
|
||||
Py_ssize_t i, length;
|
||||
int kind;
|
||||
|
|
@ -12194,6 +12202,7 @@ unicode_isspace_impl(PyObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
str.isalpha as unicode_isalpha
|
||||
|
||||
Return True if the string is an alphabetic string, False otherwise.
|
||||
|
|
@ -12204,7 +12213,7 @@ is at least one character in the string.
|
|||
|
||||
static PyObject *
|
||||
unicode_isalpha_impl(PyObject *self)
|
||||
/*[clinic end generated code: output=cc81b9ac3883ec4f input=d0fd18a96cbca5eb]*/
|
||||
/*[clinic end generated code: output=cc81b9ac3883ec4f input=c233000624a56e0d]*/
|
||||
{
|
||||
Py_ssize_t i, length;
|
||||
int kind;
|
||||
|
|
@ -12231,6 +12240,7 @@ unicode_isalpha_impl(PyObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
str.isalnum as unicode_isalnum
|
||||
|
||||
Return True if the string is an alpha-numeric string, False otherwise.
|
||||
|
|
@ -12241,7 +12251,7 @@ there is at least one character in the string.
|
|||
|
||||
static PyObject *
|
||||
unicode_isalnum_impl(PyObject *self)
|
||||
/*[clinic end generated code: output=a5a23490ffc3660c input=5c6579bf2e04758c]*/
|
||||
/*[clinic end generated code: output=a5a23490ffc3660c input=5d63ba9c9bafdb6b]*/
|
||||
{
|
||||
int kind;
|
||||
const void *data;
|
||||
|
|
@ -12270,6 +12280,7 @@ unicode_isalnum_impl(PyObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
str.isdecimal as unicode_isdecimal
|
||||
|
||||
Return True if the string is a decimal string, False otherwise.
|
||||
|
|
@ -12280,7 +12291,7 @@ there is at least one character in the string.
|
|||
|
||||
static PyObject *
|
||||
unicode_isdecimal_impl(PyObject *self)
|
||||
/*[clinic end generated code: output=fb2dcdb62d3fc548 input=336bc97ab4c8268f]*/
|
||||
/*[clinic end generated code: output=fb2dcdb62d3fc548 input=8e84a58b414935a3]*/
|
||||
{
|
||||
Py_ssize_t i, length;
|
||||
int kind;
|
||||
|
|
@ -12307,6 +12318,7 @@ unicode_isdecimal_impl(PyObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
str.isdigit as unicode_isdigit
|
||||
|
||||
Return True if the string is a digit string, False otherwise.
|
||||
|
|
@ -12317,7 +12329,7 @@ is at least one character in the string.
|
|||
|
||||
static PyObject *
|
||||
unicode_isdigit_impl(PyObject *self)
|
||||
/*[clinic end generated code: output=10a6985311da6858 input=901116c31deeea4c]*/
|
||||
/*[clinic end generated code: output=10a6985311da6858 input=99e284affb54d4a0]*/
|
||||
{
|
||||
Py_ssize_t i, length;
|
||||
int kind;
|
||||
|
|
@ -12345,6 +12357,7 @@ unicode_isdigit_impl(PyObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
str.isnumeric as unicode_isnumeric
|
||||
|
||||
Return True if the string is a numeric string, False otherwise.
|
||||
|
|
@ -12355,7 +12368,7 @@ least one character in the string.
|
|||
|
||||
static PyObject *
|
||||
unicode_isnumeric_impl(PyObject *self)
|
||||
/*[clinic end generated code: output=9172a32d9013051a input=722507db976f826c]*/
|
||||
/*[clinic end generated code: output=9172a32d9013051a input=e9f5b6b8b29b0ee6]*/
|
||||
{
|
||||
Py_ssize_t i, length;
|
||||
int kind;
|
||||
|
|
@ -12425,6 +12438,7 @@ PyUnicode_IsIdentifier(PyObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
str.isidentifier as unicode_isidentifier
|
||||
|
||||
Return True if the string is a valid Python identifier, False otherwise.
|
||||
|
|
@ -12435,12 +12449,13 @@ such as "def" or "class".
|
|||
|
||||
static PyObject *
|
||||
unicode_isidentifier_impl(PyObject *self)
|
||||
/*[clinic end generated code: output=fe585a9666572905 input=2d807a104f21c0c5]*/
|
||||
/*[clinic end generated code: output=fe585a9666572905 input=86315dd889d7bd04]*/
|
||||
{
|
||||
return PyBool_FromLong(PyUnicode_IsIdentifier(self));
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
str.isprintable as unicode_isprintable
|
||||
|
||||
Return True if all characters in the string are printable, False otherwise.
|
||||
|
|
@ -12450,7 +12465,7 @@ A character is printable if repr() may use it in its output.
|
|||
|
||||
static PyObject *
|
||||
unicode_isprintable_impl(PyObject *self)
|
||||
/*[clinic end generated code: output=3ab9626cd32dd1a0 input=4e56bcc6b06ca18c]*/
|
||||
/*[clinic end generated code: output=3ab9626cd32dd1a0 input=18345ba847084ec5]*/
|
||||
{
|
||||
Py_ssize_t i, length;
|
||||
int kind;
|
||||
|
|
@ -12474,6 +12489,7 @@ unicode_isprintable_impl(PyObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
str.join as unicode_join
|
||||
|
||||
iterable: object
|
||||
|
|
@ -12489,7 +12505,7 @@ Example: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'
|
|||
|
||||
static PyObject *
|
||||
unicode_join(PyObject *self, PyObject *iterable)
|
||||
/*[clinic end generated code: output=6857e7cecfe7bf98 input=2f70422bfb8fa189]*/
|
||||
/*[clinic end generated code: output=6857e7cecfe7bf98 input=bac724ed412ef3f8]*/
|
||||
{
|
||||
return PyUnicode_Join(self, iterable);
|
||||
}
|
||||
|
|
@ -12710,6 +12726,7 @@ do_argstrip(PyObject *self, int striptype, PyObject *sep)
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
str.strip as unicode_strip
|
||||
|
||||
chars: object = None
|
||||
|
|
@ -12722,7 +12739,7 @@ If chars is given and not None, remove characters in chars instead.
|
|||
|
||||
static PyObject *
|
||||
unicode_strip_impl(PyObject *self, PyObject *chars)
|
||||
/*[clinic end generated code: output=ca19018454345d57 input=385289c6f423b954]*/
|
||||
/*[clinic end generated code: output=ca19018454345d57 input=8bc6353450345fbd]*/
|
||||
{
|
||||
return do_argstrip(self, BOTHSTRIP, chars);
|
||||
}
|
||||
|
|
@ -12833,6 +12850,7 @@ PyUnicode_Replace(PyObject *str,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
str.replace as unicode_replace
|
||||
|
||||
old: unicode
|
||||
|
|
@ -12851,12 +12869,13 @@ replaced.
|
|||
static PyObject *
|
||||
unicode_replace_impl(PyObject *self, PyObject *old, PyObject *new,
|
||||
Py_ssize_t count)
|
||||
/*[clinic end generated code: output=b63f1a8b5eebf448 input=3345c455d60a5499]*/
|
||||
/*[clinic end generated code: output=b63f1a8b5eebf448 input=f27ca92ac46b65a1]*/
|
||||
{
|
||||
return replace(self, old, new, count);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
str.removeprefix as unicode_removeprefix
|
||||
|
||||
prefix: unicode
|
||||
|
|
@ -12870,7 +12889,7 @@ Otherwise, return a copy of the original string.
|
|||
|
||||
static PyObject *
|
||||
unicode_removeprefix_impl(PyObject *self, PyObject *prefix)
|
||||
/*[clinic end generated code: output=f1e5945e9763bcb9 input=27ec40b99a37eb88]*/
|
||||
/*[clinic end generated code: output=f1e5945e9763bcb9 input=1989a856dbb813f1]*/
|
||||
{
|
||||
int match = tailmatch(self, prefix, 0, PY_SSIZE_T_MAX, -1);
|
||||
if (match == -1) {
|
||||
|
|
@ -13003,6 +13022,7 @@ unicode_repr(PyObject *unicode)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
str.rfind as unicode_rfind = str.count
|
||||
|
||||
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].
|
||||
|
|
@ -13014,7 +13034,7 @@ Return -1 on failure.
|
|||
static Py_ssize_t
|
||||
unicode_rfind_impl(PyObject *str, PyObject *substr, Py_ssize_t start,
|
||||
Py_ssize_t end)
|
||||
/*[clinic end generated code: output=880b29f01dd014c8 input=898361fb71f59294]*/
|
||||
/*[clinic end generated code: output=880b29f01dd014c8 input=7f7e97d5cd3299a2]*/
|
||||
{
|
||||
Py_ssize_t result = any_find_slice(str, substr, start, end, -1);
|
||||
if (result < 0) {
|
||||
|
|
@ -13024,6 +13044,7 @@ unicode_rfind_impl(PyObject *str, PyObject *substr, Py_ssize_t start,
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
str.rindex as unicode_rindex = str.count
|
||||
|
||||
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].
|
||||
|
|
@ -13035,7 +13056,7 @@ Raises ValueError when the substring is not found.
|
|||
static Py_ssize_t
|
||||
unicode_rindex_impl(PyObject *str, PyObject *substr, Py_ssize_t start,
|
||||
Py_ssize_t end)
|
||||
/*[clinic end generated code: output=5f3aef124c867fe1 input=35943dead6c1ea9d]*/
|
||||
/*[clinic end generated code: output=5f3aef124c867fe1 input=0363a324740b3e62]*/
|
||||
{
|
||||
Py_ssize_t result = any_find_slice(str, substr, start, end, -1);
|
||||
if (result == -1) {
|
||||
|
|
@ -13079,6 +13100,7 @@ PyUnicode_Split(PyObject *s, PyObject *sep, Py_ssize_t maxsplit)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
str.split as unicode_split
|
||||
|
||||
sep: object = None
|
||||
|
|
@ -13103,7 +13125,7 @@ the regular expression module.
|
|||
|
||||
static PyObject *
|
||||
unicode_split_impl(PyObject *self, PyObject *sep, Py_ssize_t maxsplit)
|
||||
/*[clinic end generated code: output=3a65b1db356948dc input=a29bcc0c7a5af0eb]*/
|
||||
/*[clinic end generated code: output=3a65b1db356948dc input=2c1fd08a78e038b8]*/
|
||||
{
|
||||
if (sep == Py_None)
|
||||
return split(self, NULL, maxsplit);
|
||||
|
|
@ -13220,6 +13242,7 @@ PyUnicode_RPartition(PyObject *str_obj, PyObject *sep_obj)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
str.partition as unicode_partition
|
||||
|
||||
sep: object
|
||||
|
|
@ -13237,12 +13260,13 @@ and two empty strings.
|
|||
|
||||
static PyObject *
|
||||
unicode_partition(PyObject *self, PyObject *sep)
|
||||
/*[clinic end generated code: output=e4ced7bd253ca3c4 input=f29b8d06c63e50be]*/
|
||||
/*[clinic end generated code: output=e4ced7bd253ca3c4 input=4d854b520d7b0e97]*/
|
||||
{
|
||||
return PyUnicode_Partition(self, sep);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
str.rpartition as unicode_rpartition = str.partition
|
||||
|
||||
Partition the string into three parts using the given separator.
|
||||
|
|
@ -13257,7 +13281,7 @@ and the original string.
|
|||
|
||||
static PyObject *
|
||||
unicode_rpartition(PyObject *self, PyObject *sep)
|
||||
/*[clinic end generated code: output=1aa13cf1156572aa input=c4b7db3ef5cf336a]*/
|
||||
/*[clinic end generated code: output=1aa13cf1156572aa input=a6adabe91e75b486]*/
|
||||
{
|
||||
return PyUnicode_RPartition(self, sep);
|
||||
}
|
||||
|
|
@ -13272,6 +13296,7 @@ PyUnicode_RSplit(PyObject *s, PyObject *sep, Py_ssize_t maxsplit)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
str.rsplit as unicode_rsplit = str.split
|
||||
|
||||
Return a list of the substrings in the string, using sep as the separator string.
|
||||
|
|
@ -13281,7 +13306,7 @@ Splitting starts at the end of the string and works to the front.
|
|||
|
||||
static PyObject *
|
||||
unicode_rsplit_impl(PyObject *self, PyObject *sep, Py_ssize_t maxsplit)
|
||||
/*[clinic end generated code: output=c2b815c63bcabffc input=ea78406060fce33c]*/
|
||||
/*[clinic end generated code: output=c2b815c63bcabffc input=0f762e30d267fa83]*/
|
||||
{
|
||||
if (sep == Py_None)
|
||||
return rsplit(self, NULL, maxsplit);
|
||||
|
|
@ -13295,6 +13320,7 @@ unicode_rsplit_impl(PyObject *self, PyObject *sep, Py_ssize_t maxsplit)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
str.splitlines as unicode_splitlines
|
||||
|
||||
keepends: bool = False
|
||||
|
|
@ -13307,7 +13333,7 @@ true.
|
|||
|
||||
static PyObject *
|
||||
unicode_splitlines_impl(PyObject *self, int keepends)
|
||||
/*[clinic end generated code: output=f664dcdad153ec40 input=ba6ad05ee85d2b55]*/
|
||||
/*[clinic end generated code: output=f664dcdad153ec40 input=39eeafbfef61c827]*/
|
||||
{
|
||||
return PyUnicode_Splitlines(self, keepends);
|
||||
}
|
||||
|
|
@ -13319,6 +13345,7 @@ PyObject *unicode_str(PyObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
str.swapcase as unicode_swapcase
|
||||
|
||||
Convert uppercase characters to lowercase and lowercase characters to uppercase.
|
||||
|
|
@ -13326,7 +13353,7 @@ Convert uppercase characters to lowercase and lowercase characters to uppercase.
|
|||
|
||||
static PyObject *
|
||||
unicode_swapcase_impl(PyObject *self)
|
||||
/*[clinic end generated code: output=5d28966bf6d7b2af input=3f3ef96d5798a7bb]*/
|
||||
/*[clinic end generated code: output=5d28966bf6d7b2af input=85bc39a9b4e8ee91]*/
|
||||
{
|
||||
return case_operation(self, do_swapcase);
|
||||
}
|
||||
|
|
@ -13462,6 +13489,7 @@ unicode_maketrans_impl(PyObject *x, PyObject *y, PyObject *z)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
str.translate as unicode_translate
|
||||
|
||||
table: object
|
||||
|
|
@ -13478,7 +13506,7 @@ left untouched. Characters mapped to None are deleted.
|
|||
|
||||
static PyObject *
|
||||
unicode_translate(PyObject *self, PyObject *table)
|
||||
/*[clinic end generated code: output=3cb448ff2fd96bf3 input=6d38343db63d8eb0]*/
|
||||
/*[clinic end generated code: output=3cb448ff2fd96bf3 input=699e5fa0ebf9f5e9]*/
|
||||
{
|
||||
return _PyUnicode_TranslateCharmap(self, table, "ignore");
|
||||
}
|
||||
|
|
@ -13499,6 +13527,7 @@ unicode_upper_impl(PyObject *self)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
str.zfill as unicode_zfill
|
||||
|
||||
width: Py_ssize_t
|
||||
|
|
@ -13511,7 +13540,7 @@ The string is never truncated.
|
|||
|
||||
static PyObject *
|
||||
unicode_zfill_impl(PyObject *self, Py_ssize_t width)
|
||||
/*[clinic end generated code: output=e13fb6bdf8e3b9df input=c6b2f772c6f27799]*/
|
||||
/*[clinic end generated code: output=e13fb6bdf8e3b9df input=25a4ee0ea3e58ce0]*/
|
||||
{
|
||||
Py_ssize_t fill;
|
||||
PyObject *u;
|
||||
|
|
@ -13544,6 +13573,7 @@ unicode_zfill_impl(PyObject *self, Py_ssize_t width)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@text_signature "($self, prefix[, start[, end]], /)"
|
||||
str.startswith as unicode_startswith
|
||||
|
||||
|
|
@ -13561,7 +13591,7 @@ Return True if the string starts with the specified prefix, False otherwise.
|
|||
static PyObject *
|
||||
unicode_startswith_impl(PyObject *self, PyObject *subobj, Py_ssize_t start,
|
||||
Py_ssize_t end)
|
||||
/*[clinic end generated code: output=4bd7cfd0803051d4 input=5f918b5f5f89d856]*/
|
||||
/*[clinic end generated code: output=4bd7cfd0803051d4 input=766bdbd33df251dc]*/
|
||||
{
|
||||
if (PyTuple_Check(subobj)) {
|
||||
Py_ssize_t i;
|
||||
|
|
@ -13600,6 +13630,7 @@ unicode_startswith_impl(PyObject *self, PyObject *subobj, Py_ssize_t start,
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@text_signature "($self, suffix[, start[, end]], /)"
|
||||
str.endswith as unicode_endswith
|
||||
|
||||
|
|
@ -13617,7 +13648,7 @@ Return True if the string ends with the specified suffix, False otherwise.
|
|||
static PyObject *
|
||||
unicode_endswith_impl(PyObject *self, PyObject *subobj, Py_ssize_t start,
|
||||
Py_ssize_t end)
|
||||
/*[clinic end generated code: output=cce6f8ceb0102ca9 input=00fbdc774a7d4d71]*/
|
||||
/*[clinic end generated code: output=cce6f8ceb0102ca9 input=b66bf6d5547ba1aa]*/
|
||||
{
|
||||
if (PyTuple_Check(subobj)) {
|
||||
Py_ssize_t i;
|
||||
|
|
|
|||
|
|
@ -224,6 +224,7 @@ wait_event(HANDLE event, DWORD timeout)
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_wmi.exec_query
|
||||
|
||||
query: unicode
|
||||
|
|
@ -236,7 +237,7 @@ by null characters.
|
|||
|
||||
static PyObject *
|
||||
_wmi_exec_query_impl(PyObject *module, PyObject *query)
|
||||
/*[clinic end generated code: output=a62303d5bb5e003f input=48d2d0a1e1a7e3c2]*/
|
||||
/*[clinic end generated code: output=a62303d5bb5e003f input=621f5c50c56d06d0]*/
|
||||
|
||||
/*[clinic end generated code]*/
|
||||
{
|
||||
|
|
|
|||
|
|
@ -218,6 +218,7 @@ msvcrt_get_osfhandle_impl(PyObject *module, int fd)
|
|||
|
||||
/* Console I/O */
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
msvcrt.kbhit -> long
|
||||
|
||||
Returns a nonzero value if a keypress is waiting to be read. Otherwise, return 0.
|
||||
|
|
@ -225,7 +226,7 @@ Returns a nonzero value if a keypress is waiting to be read. Otherwise, return 0
|
|||
|
||||
static long
|
||||
msvcrt_kbhit_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=940dfce6587c1890 input=d0f4cb3289ff51e2]*/
|
||||
/*[clinic end generated code: output=940dfce6587c1890 input=52c0c44143f3fba5]*/
|
||||
{
|
||||
return _kbhit();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -251,6 +251,7 @@ PyDoc_STRVAR(build_class_doc,
|
|||
Internal helper function used by the class statement.");
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
__import__ as builtin___import__
|
||||
|
||||
name: object
|
||||
|
|
@ -279,7 +280,7 @@ is the number of parent directories to search relative to the current module.
|
|||
static PyObject *
|
||||
builtin___import___impl(PyObject *module, PyObject *name, PyObject *globals,
|
||||
PyObject *locals, PyObject *fromlist, int level)
|
||||
/*[clinic end generated code: output=4febeda88a0cd245 input=73f4b960ea5b9dd6]*/
|
||||
/*[clinic end generated code: output=4febeda88a0cd245 input=01a3283590eae93a]*/
|
||||
{
|
||||
return PyImport_ImportModuleLevelObject(name, globals, locals,
|
||||
fromlist, level);
|
||||
|
|
|
|||
|
|
@ -1007,6 +1007,7 @@ error:
|
|||
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_contextvars.ContextVar.get
|
||||
default: object = NULL
|
||||
/
|
||||
|
|
@ -1022,7 +1023,7 @@ If there is no value for the variable in the current context, the method will:
|
|||
|
||||
static PyObject *
|
||||
_contextvars_ContextVar_get_impl(PyContextVar *self, PyObject *default_value)
|
||||
/*[clinic end generated code: output=0746bd0aa2ced7bf input=30aa2ab9e433e401]*/
|
||||
/*[clinic end generated code: output=0746bd0aa2ced7bf input=da66664d5d0af4ad]*/
|
||||
{
|
||||
if (!PyContextVar_CheckExact(self)) {
|
||||
PyErr_SetString(
|
||||
|
|
@ -1044,6 +1045,7 @@ _contextvars_ContextVar_get_impl(PyContextVar *self, PyObject *default_value)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_contextvars.ContextVar.set
|
||||
value: object
|
||||
/
|
||||
|
|
@ -1058,12 +1060,13 @@ value via the `ContextVar.reset()` method.
|
|||
|
||||
static PyObject *
|
||||
_contextvars_ContextVar_set_impl(PyContextVar *self, PyObject *value)
|
||||
/*[clinic end generated code: output=1b562d35cc79c806 input=c0a6887154227453]*/
|
||||
/*[clinic end generated code: output=1b562d35cc79c806 input=73ebbbfc7c98f6cd]*/
|
||||
{
|
||||
return PyContextVar_Set((PyObject *)self, value);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_contextvars.ContextVar.reset
|
||||
token: object
|
||||
/
|
||||
|
|
@ -1076,7 +1079,7 @@ created the token was used.
|
|||
|
||||
static PyObject *
|
||||
_contextvars_ContextVar_reset_impl(PyContextVar *self, PyObject *token)
|
||||
/*[clinic end generated code: output=3205d2bdff568521 input=ebe2881e5af4ffda]*/
|
||||
/*[clinic end generated code: output=3205d2bdff568521 input=b8bc514a9245242a]*/
|
||||
{
|
||||
if (!PyContextToken_CheckExact(token)) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
|
|
|
|||
|
|
@ -4259,6 +4259,7 @@ _imp_lock_held_impl(PyObject *module)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
_imp.acquire_lock
|
||||
|
||||
Acquires the interpreter's import lock for the current thread.
|
||||
|
|
@ -4269,7 +4270,7 @@ modules. On platforms without threads, this function does nothing.
|
|||
|
||||
static PyObject *
|
||||
_imp_acquire_lock_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=1aff58cb0ee1b026 input=4a2d4381866d5fdc]*/
|
||||
/*[clinic end generated code: output=1aff58cb0ee1b026 input=e1a4ef049d34e7dd]*/
|
||||
{
|
||||
PyInterpreterState *interp = _PyInterpreterState_GET();
|
||||
_PyImport_AcquireLock(interp);
|
||||
|
|
|
|||
|
|
@ -1997,6 +1997,8 @@ marshal_load_impl(PyObject *module, PyObject *file, int allow_code)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
@permit_long_docstring_body
|
||||
marshal.dumps
|
||||
|
||||
value: object
|
||||
|
|
@ -2017,7 +2019,7 @@ unsupported type.
|
|||
static PyObject *
|
||||
marshal_dumps_impl(PyObject *module, PyObject *value, int version,
|
||||
int allow_code)
|
||||
/*[clinic end generated code: output=115f90da518d1d49 input=167eaecceb63f0a8]*/
|
||||
/*[clinic end generated code: output=115f90da518d1d49 input=80cd3f30c1637ade]*/
|
||||
{
|
||||
return _PyMarshal_WriteObjectToString(value, version, allow_code);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1160,6 +1160,7 @@ sys_settrace(PyObject *module, PyObject *function)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
sys._settraceallthreads
|
||||
|
||||
function as arg: object
|
||||
|
|
@ -1173,7 +1174,7 @@ in the library manual.
|
|||
|
||||
static PyObject *
|
||||
sys__settraceallthreads(PyObject *module, PyObject *arg)
|
||||
/*[clinic end generated code: output=161cca30207bf3ca input=d4bde1f810d73675]*/
|
||||
/*[clinic end generated code: output=161cca30207bf3ca input=e5750f5dc01142eb]*/
|
||||
{
|
||||
PyObject* argument = NULL;
|
||||
Py_tracefunc func = NULL;
|
||||
|
|
@ -1241,6 +1242,7 @@ sys_setprofile(PyObject *module, PyObject *function)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
sys._setprofileallthreads
|
||||
|
||||
function as arg: object
|
||||
|
|
@ -1254,7 +1256,7 @@ chapter in the library manual.
|
|||
|
||||
static PyObject *
|
||||
sys__setprofileallthreads(PyObject *module, PyObject *arg)
|
||||
/*[clinic end generated code: output=2d61319e27b309fe input=a10589439ba20cee]*/
|
||||
/*[clinic end generated code: output=2d61319e27b309fe input=9a3dc3352c63b471]*/
|
||||
{
|
||||
PyObject* argument = NULL;
|
||||
Py_tracefunc func = NULL;
|
||||
|
|
@ -2141,6 +2143,7 @@ sys__current_frames_impl(PyObject *module)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
sys._current_exceptions
|
||||
|
||||
Return a dict mapping each thread's identifier to its current raised exception.
|
||||
|
|
@ -2150,7 +2153,7 @@ This function should be used for specialized purposes only.
|
|||
|
||||
static PyObject *
|
||||
sys__current_exceptions_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=2ccfd838c746f0ba input=0e91818fbf2edc1f]*/
|
||||
/*[clinic end generated code: output=2ccfd838c746f0ba input=4ba429b6cfcd736d]*/
|
||||
{
|
||||
return _PyThread_CurrentExceptions();
|
||||
}
|
||||
|
|
@ -2311,6 +2314,7 @@ sys__stats_clear_impl(PyObject *module)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_docstring_body
|
||||
sys._stats_dump -> bool
|
||||
|
||||
Dump stats to file, and clears the stats.
|
||||
|
|
@ -2320,7 +2324,7 @@ Return False if no statistics were not dumped because stats gathering was off.
|
|||
|
||||
static int
|
||||
sys__stats_dump_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=6e346b4ba0de4489 input=31a489e39418b2a5]*/
|
||||
/*[clinic end generated code: output=6e346b4ba0de4489 input=5a3ab40d2fb5af47]*/
|
||||
{
|
||||
int res = _Py_PrintSpecializationStats(1);
|
||||
_Py_StatsClear();
|
||||
|
|
@ -4017,13 +4021,14 @@ module _jit
|
|||
PyDoc_STRVAR(_jit_doc, "Utilities for observing just-in-time compilation.");
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_jit.is_available -> bool
|
||||
Return True if the current Python executable supports JIT compilation, and False otherwise.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static int
|
||||
_jit_is_available_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=6849a9cd2ff4aac9 input=03add84aa8347cf1]*/
|
||||
/*[clinic end generated code: output=6849a9cd2ff4aac9 input=d009d751ae64c9ef]*/
|
||||
{
|
||||
(void)module;
|
||||
#ifdef _Py_TIER2
|
||||
|
|
@ -4034,26 +4039,28 @@ _jit_is_available_impl(PyObject *module)
|
|||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_jit.is_enabled -> bool
|
||||
Return True if JIT compilation is enabled for the current Python process (implies sys._jit.is_available()), and False otherwise.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static int
|
||||
_jit_is_enabled_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=55865f8de993fe42 input=02439394da8e873f]*/
|
||||
/*[clinic end generated code: output=55865f8de993fe42 input=0524151e857f4f3a]*/
|
||||
{
|
||||
(void)module;
|
||||
return _PyInterpreterState_GET()->jit;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@permit_long_summary
|
||||
_jit.is_active -> bool
|
||||
Return True if the topmost Python frame is currently executing JIT code (implies sys._jit.is_enabled()), and False otherwise.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static int
|
||||
_jit_is_active_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=7facca06b10064d4 input=be2fcd8a269d9b72]*/
|
||||
/*[clinic end generated code: output=7facca06b10064d4 input=081ee32563dc2086]*/
|
||||
{
|
||||
(void)module;
|
||||
return _PyThreadState_GET()->current_executor != NULL;
|
||||
|
|
|
|||
|
|
@ -1,299 +0,0 @@
|
|||
OVERLONG_SUMMARY = frozenset((
|
||||
# Lib/test/
|
||||
'test_preprocessor_guarded_if_e_or_f',
|
||||
|
||||
# Modules/
|
||||
'_abc._abc_init',
|
||||
'_abc._abc_instancecheck',
|
||||
'_abc._abc_register',
|
||||
'_abc._abc_subclasscheck',
|
||||
'_codecs.lookup',
|
||||
'_ctypes.byref',
|
||||
'_curses.can_change_color',
|
||||
'_curses.is_term_resized',
|
||||
'_curses.mousemask',
|
||||
'_curses.reset_prog_mode',
|
||||
'_curses.reset_shell_mode',
|
||||
'_curses.termname',
|
||||
'_curses.window.enclose',
|
||||
'_functools.reduce',
|
||||
'_gdbm.gdbm.setdefault',
|
||||
'_hashlib.HMAC.hexdigest',
|
||||
'_hashlib.openssl_shake_128',
|
||||
'_hashlib.openssl_shake_256',
|
||||
'_hashlib.pbkdf2_hmac',
|
||||
'_hmac.HMAC.hexdigest',
|
||||
'_interpreters.is_shareable',
|
||||
'_io._BufferedIOBase.read1',
|
||||
'_lzma._decode_filter_properties',
|
||||
'_remote_debugging.RemoteUnwinder.__init__',
|
||||
'_remote_debugging.RemoteUnwinder.get_all_awaited_by',
|
||||
'_remote_debugging.RemoteUnwinder.get_async_stack_trace',
|
||||
'_socket.inet_aton',
|
||||
'_sre.SRE_Match.expand',
|
||||
'_sre.SRE_Match.groupdict',
|
||||
'_sre.SRE_Pattern.finditer',
|
||||
'_sre.SRE_Pattern.search',
|
||||
'_sre.SRE_Pattern.sub',
|
||||
'_sre.SRE_Pattern.subn',
|
||||
'_ssl._SSLContext.sni_callback',
|
||||
'_ssl._SSLSocket.pending',
|
||||
'_ssl._SSLSocket.sendfile',
|
||||
'_ssl.get_default_verify_paths',
|
||||
'_ssl.RAND_status',
|
||||
'_sysconfig.config_vars',
|
||||
'_testcapi.make_exception_with_doc',
|
||||
'_testcapi.VectorCallClass.set_vectorcall',
|
||||
'_tkinter.getbusywaitinterval',
|
||||
'_tkinter.setbusywaitinterval',
|
||||
'_tracemalloc.reset_peak',
|
||||
'_zstd.get_frame_size',
|
||||
'_zstd.set_parameter_types',
|
||||
'_zstd.ZstdDecompressor.decompress',
|
||||
'array.array.buffer_info',
|
||||
'array.array.frombytes',
|
||||
'array.array.fromfile',
|
||||
'array.array.tobytes',
|
||||
'cmath.isfinite',
|
||||
'datetime.datetime.strptime',
|
||||
'gc.get_objects',
|
||||
'itertools.chain.from_iterable',
|
||||
'itertools.combinations_with_replacement.__new__',
|
||||
'itertools.cycle.__new__',
|
||||
'itertools.starmap.__new__',
|
||||
'itertools.takewhile.__new__',
|
||||
'math.comb',
|
||||
'math.perm',
|
||||
'os.getresgid',
|
||||
'os.lstat',
|
||||
'os.pread',
|
||||
'os.pwritev',
|
||||
'os.sched_getaffinity',
|
||||
'os.sched_rr_get_interval',
|
||||
'os.timerfd_gettime',
|
||||
'os.timerfd_gettime_ns',
|
||||
'os.urandom',
|
||||
'os.WIFEXITED',
|
||||
'os.WTERMSIG',
|
||||
'pwd.getpwall',
|
||||
'pyexpat.xmlparser.ExternalEntityParserCreate',
|
||||
'pyexpat.xmlparser.GetReparseDeferralEnabled',
|
||||
'pyexpat.xmlparser.SetParamEntityParsing',
|
||||
'pyexpat.xmlparser.UseForeignDTD',
|
||||
'readline.redisplay',
|
||||
'signal.set_wakeup_fd',
|
||||
'unicodedata.UCD.combining',
|
||||
'unicodedata.UCD.decomposition',
|
||||
'zoneinfo.ZoneInfo.dst',
|
||||
'zoneinfo.ZoneInfo.tzname',
|
||||
'zoneinfo.ZoneInfo.utcoffset',
|
||||
|
||||
# Objects/
|
||||
'B.zfill',
|
||||
'bytearray.count',
|
||||
'bytearray.endswith',
|
||||
'bytearray.extend',
|
||||
'bytearray.find',
|
||||
'bytearray.index',
|
||||
'bytearray.maketrans',
|
||||
'bytearray.rfind',
|
||||
'bytearray.rindex',
|
||||
'bytearray.rsplit',
|
||||
'bytearray.split',
|
||||
'bytearray.splitlines',
|
||||
'bytearray.startswith',
|
||||
'bytes.count',
|
||||
'bytes.endswith',
|
||||
'bytes.find',
|
||||
'bytes.index',
|
||||
'bytes.maketrans',
|
||||
'bytes.rfind',
|
||||
'bytes.rindex',
|
||||
'bytes.startswith',
|
||||
'code.replace',
|
||||
'complex.conjugate',
|
||||
'dict.pop',
|
||||
'float.as_integer_ratio',
|
||||
'frame.f_trace',
|
||||
'int.bit_count',
|
||||
'OrderedDict.fromkeys',
|
||||
'OrderedDict.pop',
|
||||
'set.symmetric_difference_update',
|
||||
'str.count',
|
||||
'str.endswith',
|
||||
'str.find',
|
||||
'str.index',
|
||||
'str.isprintable',
|
||||
'str.rfind',
|
||||
'str.rindex',
|
||||
'str.rsplit',
|
||||
'str.split',
|
||||
'str.startswith',
|
||||
'str.strip',
|
||||
'str.swapcase',
|
||||
'str.zfill',
|
||||
|
||||
# PC/
|
||||
'msvcrt.kbhit',
|
||||
|
||||
# Python/
|
||||
'_jit.is_active',
|
||||
'_jit.is_available',
|
||||
'_jit.is_enabled',
|
||||
'marshal.dumps',
|
||||
'sys._current_exceptions',
|
||||
'sys._setprofileallthreads',
|
||||
'sys._settraceallthreads',
|
||||
))
|
||||
|
||||
OVERLONG_BODY = frozenset((
|
||||
# Modules/
|
||||
'_bz2.BZ2Decompressor.decompress',
|
||||
'_curses.color_content',
|
||||
'_curses.flash',
|
||||
'_curses.longname',
|
||||
'_curses.resize_term',
|
||||
'_curses.use_env',
|
||||
'_curses.window.border',
|
||||
'_curses.window.derwin',
|
||||
'_curses.window.getch',
|
||||
'_curses.window.getkey',
|
||||
'_curses.window.inch',
|
||||
'_curses.window.insch',
|
||||
'_curses.window.insnstr',
|
||||
'_curses.window.is_linetouched',
|
||||
'_curses.window.noutrefresh',
|
||||
'_curses.window.overlay',
|
||||
'_curses.window.overwrite',
|
||||
'_curses.window.refresh',
|
||||
'_curses.window.scroll',
|
||||
'_curses.window.subwin',
|
||||
'_curses.window.touchline',
|
||||
'_curses_panel.panel.hide',
|
||||
'_functools.reduce',
|
||||
'_hashlib.HMAC.hexdigest',
|
||||
'_hmac.HMAC.hexdigest',
|
||||
'_interpreters.capture_exception',
|
||||
'_io._IOBase.seek',
|
||||
'_io._TextIOBase.detach',
|
||||
'_io.FileIO.read',
|
||||
'_io.FileIO.readall',
|
||||
'_io.FileIO.seek',
|
||||
'_io.open',
|
||||
'_io.open_code',
|
||||
'_lzma.LZMADecompressor.decompress',
|
||||
'_multibytecodec.MultibyteCodec.decode',
|
||||
'_multibytecodec.MultibyteCodec.encode',
|
||||
'_posixsubprocess.fork_exec',
|
||||
'_remote_debugging.RemoteUnwinder.__init__',
|
||||
'_remote_debugging.RemoteUnwinder.get_all_awaited_by',
|
||||
'_remote_debugging.RemoteUnwinder.get_async_stack_trace',
|
||||
'_remote_debugging.RemoteUnwinder.get_stack_trace',
|
||||
'_socket.socket.send',
|
||||
'_sqlite3.Blob.read',
|
||||
'_sqlite3.Blob.seek',
|
||||
'_sqlite3.Blob.write',
|
||||
'_sqlite3.Connection.deserialize',
|
||||
'_sqlite3.Connection.serialize',
|
||||
'_sqlite3.Connection.set_progress_handler',
|
||||
'_sqlite3.Connection.setlimit',
|
||||
'_ssl._SSLContext.sni_callback',
|
||||
'_ssl._SSLSocket.context',
|
||||
'_ssl._SSLSocket.get_channel_binding',
|
||||
'_ssl._SSLSocket.sendfile',
|
||||
'_tkinter.setbusywaitinterval',
|
||||
'_zstd.ZstdCompressor.compress',
|
||||
'_zstd.ZstdCompressor.flush',
|
||||
'_zstd.ZstdCompressor.set_pledged_input_size',
|
||||
'_zstd.ZstdDecompressor.__new__',
|
||||
'_zstd.ZstdDecompressor.decompress',
|
||||
'_zstd.ZstdDecompressor.unused_data',
|
||||
'_zstd.ZstdDict.__new__',
|
||||
'_zstd.ZstdDict.as_digested_dict',
|
||||
'_zstd.ZstdDict.as_prefix',
|
||||
'_zstd.ZstdDict.as_undigested_dict',
|
||||
'array.array.byteswap',
|
||||
'array.array.fromunicode',
|
||||
'array.array.tounicode',
|
||||
'binascii.a2b_base64',
|
||||
'cmath.isclose',
|
||||
'datetime.date.fromtimestamp',
|
||||
'datetime.datetime.fromtimestamp',
|
||||
'datetime.time.strftime',
|
||||
'fcntl.ioctl',
|
||||
'fcntl.lockf',
|
||||
'gc.freeze',
|
||||
'itertools.combinations_with_replacement.__new__',
|
||||
'math.nextafter',
|
||||
'os.fspath',
|
||||
'os.link',
|
||||
'os.listdir',
|
||||
'os.listxattr',
|
||||
'os.lseek',
|
||||
'os.mknod',
|
||||
'os.preadv',
|
||||
'os.pwritev',
|
||||
'os.readinto',
|
||||
'os.rename',
|
||||
'os.replace',
|
||||
'os.setxattr',
|
||||
'pyexpat.xmlparser.GetInputContext',
|
||||
'pyexpat.xmlparser.UseForeignDTD',
|
||||
'select.devpoll',
|
||||
'select.poll',
|
||||
'select.select',
|
||||
'signal.setitimer',
|
||||
'signal.signal',
|
||||
'termios.tcsetwinsize',
|
||||
'zlib.Decompress.decompress',
|
||||
'zlib.ZlibDecompressor.decompress',
|
||||
|
||||
# Objects/
|
||||
'bytearray.maketrans',
|
||||
'bytearray.partition',
|
||||
'bytearray.replace',
|
||||
'bytearray.rpartition',
|
||||
'bytearray.rsplit',
|
||||
'bytearray.splitlines',
|
||||
'bytearray.strip',
|
||||
'bytes.maketrans',
|
||||
'bytes.partition',
|
||||
'bytes.replace',
|
||||
'bytes.rpartition',
|
||||
'bytes.rsplit',
|
||||
'bytes.splitlines',
|
||||
'bytes.strip',
|
||||
'float.__getformat__',
|
||||
'list.sort',
|
||||
'memoryview.tobytes',
|
||||
'str.capitalize',
|
||||
'str.isalnum',
|
||||
'str.isalpha',
|
||||
'str.isdecimal',
|
||||
'str.isdigit',
|
||||
'str.isidentifier',
|
||||
'str.islower',
|
||||
'str.isnumeric',
|
||||
'str.isspace',
|
||||
'str.isupper',
|
||||
'str.join',
|
||||
'str.partition',
|
||||
'str.removeprefix',
|
||||
'str.replace',
|
||||
'str.rpartition',
|
||||
'str.splitlines',
|
||||
'str.title',
|
||||
'str.translate',
|
||||
|
||||
# PC/
|
||||
'_wmi.exec_query',
|
||||
|
||||
# Python/
|
||||
'__import__',
|
||||
'_contextvars.ContextVar.get',
|
||||
'_contextvars.ContextVar.reset',
|
||||
'_contextvars.ContextVar.set',
|
||||
'_imp.acquire_lock',
|
||||
'marshal.dumps',
|
||||
'sys._stats_dump',
|
||||
))
|
||||
|
|
@ -14,7 +14,6 @@ import libclinic
|
|||
from libclinic import (
|
||||
ClinicError, VersionTuple,
|
||||
fail, warn, unspecified, unknown, NULL)
|
||||
from libclinic._overlong_docstrings import OVERLONG_SUMMARY, OVERLONG_BODY
|
||||
from libclinic.function import (
|
||||
Module, Class, Function, Parameter,
|
||||
FunctionKind,
|
||||
|
|
@ -263,6 +262,8 @@ class DSLParser:
|
|||
target_critical_section: list[str]
|
||||
disable_fastcall: bool
|
||||
from_version_re = re.compile(r'([*/]) +\[from +(.+)\]')
|
||||
permit_long_summary = False
|
||||
permit_long_docstring_body = False
|
||||
|
||||
def __init__(self, clinic: Clinic) -> None:
|
||||
self.clinic = clinic
|
||||
|
|
@ -299,6 +300,8 @@ class DSLParser:
|
|||
self.critical_section = False
|
||||
self.target_critical_section = []
|
||||
self.disable_fastcall = False
|
||||
self.permit_long_summary = False
|
||||
self.permit_long_docstring_body = False
|
||||
|
||||
def directive_module(self, name: str) -> None:
|
||||
fields = name.split('.')[:-1]
|
||||
|
|
@ -471,6 +474,16 @@ class DSLParser:
|
|||
fail("Called @text_signature twice!")
|
||||
self.forced_text_signature = text_signature
|
||||
|
||||
def at_permit_long_summary(self) -> None:
|
||||
if self.permit_long_summary:
|
||||
fail("Called @permit_long_summary twice!")
|
||||
self.permit_long_summary = True
|
||||
|
||||
def at_permit_long_docstring_body(self) -> None:
|
||||
if self.permit_long_docstring_body:
|
||||
fail("Called @permit_long_docstring_body twice!")
|
||||
self.permit_long_docstring_body = True
|
||||
|
||||
def parse(self, block: Block) -> None:
|
||||
self.reset()
|
||||
self.block = block
|
||||
|
|
@ -1523,20 +1536,22 @@ class DSLParser:
|
|||
summary_len = len(lines[0])
|
||||
max_body = max(map(len, lines[1:]))
|
||||
if summary_len > max_width:
|
||||
if f.full_name not in OVERLONG_SUMMARY:
|
||||
if not self.permit_long_summary:
|
||||
fail(f"Summary line for {f.full_name!r} is too long!\n"
|
||||
f"The summary line must be no longer than {max_width} characters.")
|
||||
else:
|
||||
if f.full_name in OVERLONG_SUMMARY:
|
||||
warn(f"Remove {f.full_name!r} from OVERLONG_SUMMARY!\n")
|
||||
if self.permit_long_summary:
|
||||
warn("Remove the @permit_long_summary decorator from "
|
||||
f"{f.full_name!r}!\n")
|
||||
|
||||
if max_body > max_width:
|
||||
if f.full_name not in OVERLONG_BODY:
|
||||
if not self.permit_long_docstring_body:
|
||||
warn(f"Docstring lines for {f.full_name!r} are too long!\n"
|
||||
f"Lines should be no longer than {max_width} characters.")
|
||||
else:
|
||||
if f.full_name in OVERLONG_BODY:
|
||||
warn(f"Remove {f.full_name!r} from OVERLONG_BODY!\n")
|
||||
if self.permit_long_docstring_body:
|
||||
warn("Remove the @permit_long_docstring_body decorator from "
|
||||
f"{f.full_name!r}!\n")
|
||||
|
||||
parameters_marker_count = len(f.docstring.split('{parameters}')) - 1
|
||||
if parameters_marker_count > 1:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue