1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172 |
- /*[clinic input]
- preserve
- [clinic start generated code]*/
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- # include "pycore_gc.h" // PyGC_Head
- # include "pycore_runtime.h" // _Py_ID()
- #endif
- PyDoc_STRVAR(test_empty_function__doc__,
- "test_empty_function($module, /)\n"
- "--\n"
- "\n");
- #define TEST_EMPTY_FUNCTION_METHODDEF \
- {"test_empty_function", (PyCFunction)test_empty_function, METH_NOARGS, test_empty_function__doc__},
- static PyObject *
- test_empty_function_impl(PyObject *module);
- static PyObject *
- test_empty_function(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return test_empty_function_impl(module);
- }
- PyDoc_STRVAR(objects_converter__doc__,
- "objects_converter($module, a, b=<unrepresentable>, /)\n"
- "--\n"
- "\n");
- #define OBJECTS_CONVERTER_METHODDEF \
- {"objects_converter", _PyCFunction_CAST(objects_converter), METH_FASTCALL, objects_converter__doc__},
- static PyObject *
- objects_converter_impl(PyObject *module, PyObject *a, PyObject *b);
- static PyObject *
- objects_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- PyObject *a;
- PyObject *b = NULL;
- if (!_PyArg_CheckPositional("objects_converter", nargs, 1, 2)) {
- goto exit;
- }
- a = args[0];
- if (nargs < 2) {
- goto skip_optional;
- }
- b = args[1];
- skip_optional:
- return_value = objects_converter_impl(module, a, b);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(bytes_object_converter__doc__,
- "bytes_object_converter($module, a, /)\n"
- "--\n"
- "\n");
- #define BYTES_OBJECT_CONVERTER_METHODDEF \
- {"bytes_object_converter", (PyCFunction)bytes_object_converter, METH_O, bytes_object_converter__doc__},
- static PyObject *
- bytes_object_converter_impl(PyObject *module, PyBytesObject *a);
- static PyObject *
- bytes_object_converter(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- PyBytesObject *a;
- if (!PyBytes_Check(arg)) {
- _PyArg_BadArgument("bytes_object_converter", "argument", "bytes", arg);
- goto exit;
- }
- a = (PyBytesObject *)arg;
- return_value = bytes_object_converter_impl(module, a);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(byte_array_object_converter__doc__,
- "byte_array_object_converter($module, a, /)\n"
- "--\n"
- "\n");
- #define BYTE_ARRAY_OBJECT_CONVERTER_METHODDEF \
- {"byte_array_object_converter", (PyCFunction)byte_array_object_converter, METH_O, byte_array_object_converter__doc__},
- static PyObject *
- byte_array_object_converter_impl(PyObject *module, PyByteArrayObject *a);
- static PyObject *
- byte_array_object_converter(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- PyByteArrayObject *a;
- if (!PyByteArray_Check(arg)) {
- _PyArg_BadArgument("byte_array_object_converter", "argument", "bytearray", arg);
- goto exit;
- }
- a = (PyByteArrayObject *)arg;
- return_value = byte_array_object_converter_impl(module, a);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(unicode_converter__doc__,
- "unicode_converter($module, a, /)\n"
- "--\n"
- "\n");
- #define UNICODE_CONVERTER_METHODDEF \
- {"unicode_converter", (PyCFunction)unicode_converter, METH_O, unicode_converter__doc__},
- static PyObject *
- unicode_converter_impl(PyObject *module, PyObject *a);
- static PyObject *
- unicode_converter(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- PyObject *a;
- if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("unicode_converter", "argument", "str", arg);
- goto exit;
- }
- if (PyUnicode_READY(arg) == -1) {
- goto exit;
- }
- a = arg;
- return_value = unicode_converter_impl(module, a);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(bool_converter__doc__,
- "bool_converter($module, a=True, b=True, c=True, /)\n"
- "--\n"
- "\n");
- #define BOOL_CONVERTER_METHODDEF \
- {"bool_converter", _PyCFunction_CAST(bool_converter), METH_FASTCALL, bool_converter__doc__},
- static PyObject *
- bool_converter_impl(PyObject *module, int a, int b, int c);
- static PyObject *
- bool_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- int a = 1;
- int b = 1;
- int c = 1;
- if (!_PyArg_CheckPositional("bool_converter", nargs, 0, 3)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- a = PyObject_IsTrue(args[0]);
- if (a < 0) {
- goto exit;
- }
- if (nargs < 2) {
- goto skip_optional;
- }
- b = PyObject_IsTrue(args[1]);
- if (b < 0) {
- goto exit;
- }
- if (nargs < 3) {
- goto skip_optional;
- }
- c = _PyLong_AsInt(args[2]);
- if (c == -1 && PyErr_Occurred()) {
- goto exit;
- }
- skip_optional:
- return_value = bool_converter_impl(module, a, b, c);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(char_converter__doc__,
- "char_converter($module, a=b\'A\', b=b\'\\x07\', c=b\'\\x08\', d=b\'\\t\', e=b\'\\n\',\n"
- " f=b\'\\x0b\', g=b\'\\x0c\', h=b\'\\r\', i=b\'\"\', j=b\"\'\", k=b\'?\',\n"
- " l=b\'\\\\\', m=b\'\\x00\', n=b\'\\xff\', /)\n"
- "--\n"
- "\n");
- #define CHAR_CONVERTER_METHODDEF \
- {"char_converter", _PyCFunction_CAST(char_converter), METH_FASTCALL, char_converter__doc__},
- static PyObject *
- char_converter_impl(PyObject *module, char a, char b, char c, char d, char e,
- char f, char g, char h, char i, char j, char k, char l,
- char m, char n);
- static PyObject *
- char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- char a = 'A';
- char b = '\x07';
- char c = '\x08';
- char d = '\t';
- char e = '\n';
- char f = '\x0b';
- char g = '\x0c';
- char h = '\r';
- char i = '"';
- char j = '\'';
- char k = '?';
- char l = '\\';
- char m = '\x00';
- char n = '\xff';
- if (!_PyArg_CheckPositional("char_converter", nargs, 0, 14)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- if (PyBytes_Check(args[0]) && PyBytes_GET_SIZE(args[0]) == 1) {
- a = PyBytes_AS_STRING(args[0])[0];
- }
- else if (PyByteArray_Check(args[0]) && PyByteArray_GET_SIZE(args[0]) == 1) {
- a = PyByteArray_AS_STRING(args[0])[0];
- }
- else {
- _PyArg_BadArgument("char_converter", "argument 1", "a byte string of length 1", args[0]);
- goto exit;
- }
- if (nargs < 2) {
- goto skip_optional;
- }
- if (PyBytes_Check(args[1]) && PyBytes_GET_SIZE(args[1]) == 1) {
- b = PyBytes_AS_STRING(args[1])[0];
- }
- else if (PyByteArray_Check(args[1]) && PyByteArray_GET_SIZE(args[1]) == 1) {
- b = PyByteArray_AS_STRING(args[1])[0];
- }
- else {
- _PyArg_BadArgument("char_converter", "argument 2", "a byte string of length 1", args[1]);
- goto exit;
- }
- if (nargs < 3) {
- goto skip_optional;
- }
- if (PyBytes_Check(args[2]) && PyBytes_GET_SIZE(args[2]) == 1) {
- c = PyBytes_AS_STRING(args[2])[0];
- }
- else if (PyByteArray_Check(args[2]) && PyByteArray_GET_SIZE(args[2]) == 1) {
- c = PyByteArray_AS_STRING(args[2])[0];
- }
- else {
- _PyArg_BadArgument("char_converter", "argument 3", "a byte string of length 1", args[2]);
- goto exit;
- }
- if (nargs < 4) {
- goto skip_optional;
- }
- if (PyBytes_Check(args[3]) && PyBytes_GET_SIZE(args[3]) == 1) {
- d = PyBytes_AS_STRING(args[3])[0];
- }
- else if (PyByteArray_Check(args[3]) && PyByteArray_GET_SIZE(args[3]) == 1) {
- d = PyByteArray_AS_STRING(args[3])[0];
- }
- else {
- _PyArg_BadArgument("char_converter", "argument 4", "a byte string of length 1", args[3]);
- goto exit;
- }
- if (nargs < 5) {
- goto skip_optional;
- }
- if (PyBytes_Check(args[4]) && PyBytes_GET_SIZE(args[4]) == 1) {
- e = PyBytes_AS_STRING(args[4])[0];
- }
- else if (PyByteArray_Check(args[4]) && PyByteArray_GET_SIZE(args[4]) == 1) {
- e = PyByteArray_AS_STRING(args[4])[0];
- }
- else {
- _PyArg_BadArgument("char_converter", "argument 5", "a byte string of length 1", args[4]);
- goto exit;
- }
- if (nargs < 6) {
- goto skip_optional;
- }
- if (PyBytes_Check(args[5]) && PyBytes_GET_SIZE(args[5]) == 1) {
- f = PyBytes_AS_STRING(args[5])[0];
- }
- else if (PyByteArray_Check(args[5]) && PyByteArray_GET_SIZE(args[5]) == 1) {
- f = PyByteArray_AS_STRING(args[5])[0];
- }
- else {
- _PyArg_BadArgument("char_converter", "argument 6", "a byte string of length 1", args[5]);
- goto exit;
- }
- if (nargs < 7) {
- goto skip_optional;
- }
- if (PyBytes_Check(args[6]) && PyBytes_GET_SIZE(args[6]) == 1) {
- g = PyBytes_AS_STRING(args[6])[0];
- }
- else if (PyByteArray_Check(args[6]) && PyByteArray_GET_SIZE(args[6]) == 1) {
- g = PyByteArray_AS_STRING(args[6])[0];
- }
- else {
- _PyArg_BadArgument("char_converter", "argument 7", "a byte string of length 1", args[6]);
- goto exit;
- }
- if (nargs < 8) {
- goto skip_optional;
- }
- if (PyBytes_Check(args[7]) && PyBytes_GET_SIZE(args[7]) == 1) {
- h = PyBytes_AS_STRING(args[7])[0];
- }
- else if (PyByteArray_Check(args[7]) && PyByteArray_GET_SIZE(args[7]) == 1) {
- h = PyByteArray_AS_STRING(args[7])[0];
- }
- else {
- _PyArg_BadArgument("char_converter", "argument 8", "a byte string of length 1", args[7]);
- goto exit;
- }
- if (nargs < 9) {
- goto skip_optional;
- }
- if (PyBytes_Check(args[8]) && PyBytes_GET_SIZE(args[8]) == 1) {
- i = PyBytes_AS_STRING(args[8])[0];
- }
- else if (PyByteArray_Check(args[8]) && PyByteArray_GET_SIZE(args[8]) == 1) {
- i = PyByteArray_AS_STRING(args[8])[0];
- }
- else {
- _PyArg_BadArgument("char_converter", "argument 9", "a byte string of length 1", args[8]);
- goto exit;
- }
- if (nargs < 10) {
- goto skip_optional;
- }
- if (PyBytes_Check(args[9]) && PyBytes_GET_SIZE(args[9]) == 1) {
- j = PyBytes_AS_STRING(args[9])[0];
- }
- else if (PyByteArray_Check(args[9]) && PyByteArray_GET_SIZE(args[9]) == 1) {
- j = PyByteArray_AS_STRING(args[9])[0];
- }
- else {
- _PyArg_BadArgument("char_converter", "argument 10", "a byte string of length 1", args[9]);
- goto exit;
- }
- if (nargs < 11) {
- goto skip_optional;
- }
- if (PyBytes_Check(args[10]) && PyBytes_GET_SIZE(args[10]) == 1) {
- k = PyBytes_AS_STRING(args[10])[0];
- }
- else if (PyByteArray_Check(args[10]) && PyByteArray_GET_SIZE(args[10]) == 1) {
- k = PyByteArray_AS_STRING(args[10])[0];
- }
- else {
- _PyArg_BadArgument("char_converter", "argument 11", "a byte string of length 1", args[10]);
- goto exit;
- }
- if (nargs < 12) {
- goto skip_optional;
- }
- if (PyBytes_Check(args[11]) && PyBytes_GET_SIZE(args[11]) == 1) {
- l = PyBytes_AS_STRING(args[11])[0];
- }
- else if (PyByteArray_Check(args[11]) && PyByteArray_GET_SIZE(args[11]) == 1) {
- l = PyByteArray_AS_STRING(args[11])[0];
- }
- else {
- _PyArg_BadArgument("char_converter", "argument 12", "a byte string of length 1", args[11]);
- goto exit;
- }
- if (nargs < 13) {
- goto skip_optional;
- }
- if (PyBytes_Check(args[12]) && PyBytes_GET_SIZE(args[12]) == 1) {
- m = PyBytes_AS_STRING(args[12])[0];
- }
- else if (PyByteArray_Check(args[12]) && PyByteArray_GET_SIZE(args[12]) == 1) {
- m = PyByteArray_AS_STRING(args[12])[0];
- }
- else {
- _PyArg_BadArgument("char_converter", "argument 13", "a byte string of length 1", args[12]);
- goto exit;
- }
- if (nargs < 14) {
- goto skip_optional;
- }
- if (PyBytes_Check(args[13]) && PyBytes_GET_SIZE(args[13]) == 1) {
- n = PyBytes_AS_STRING(args[13])[0];
- }
- else if (PyByteArray_Check(args[13]) && PyByteArray_GET_SIZE(args[13]) == 1) {
- n = PyByteArray_AS_STRING(args[13])[0];
- }
- else {
- _PyArg_BadArgument("char_converter", "argument 14", "a byte string of length 1", args[13]);
- goto exit;
- }
- skip_optional:
- return_value = char_converter_impl(module, a, b, c, d, e, f, g, h, i, j, k, l, m, n);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(unsigned_char_converter__doc__,
- "unsigned_char_converter($module, a=12, b=34, c=56, /)\n"
- "--\n"
- "\n");
- #define UNSIGNED_CHAR_CONVERTER_METHODDEF \
- {"unsigned_char_converter", _PyCFunction_CAST(unsigned_char_converter), METH_FASTCALL, unsigned_char_converter__doc__},
- static PyObject *
- unsigned_char_converter_impl(PyObject *module, unsigned char a,
- unsigned char b, unsigned char c);
- static PyObject *
- unsigned_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- unsigned char a = 12;
- unsigned char b = 34;
- unsigned char c = 56;
- if (!_PyArg_CheckPositional("unsigned_char_converter", nargs, 0, 3)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- {
- long ival = PyLong_AsLong(args[0]);
- if (ival == -1 && PyErr_Occurred()) {
- goto exit;
- }
- else if (ival < 0) {
- PyErr_SetString(PyExc_OverflowError,
- "unsigned byte integer is less than minimum");
- goto exit;
- }
- else if (ival > UCHAR_MAX) {
- PyErr_SetString(PyExc_OverflowError,
- "unsigned byte integer is greater than maximum");
- goto exit;
- }
- else {
- a = (unsigned char) ival;
- }
- }
- if (nargs < 2) {
- goto skip_optional;
- }
- {
- long ival = PyLong_AsLong(args[1]);
- if (ival == -1 && PyErr_Occurred()) {
- goto exit;
- }
- else if (ival < 0) {
- PyErr_SetString(PyExc_OverflowError,
- "unsigned byte integer is less than minimum");
- goto exit;
- }
- else if (ival > UCHAR_MAX) {
- PyErr_SetString(PyExc_OverflowError,
- "unsigned byte integer is greater than maximum");
- goto exit;
- }
- else {
- b = (unsigned char) ival;
- }
- }
- if (nargs < 3) {
- goto skip_optional;
- }
- {
- unsigned long ival = PyLong_AsUnsignedLongMask(args[2]);
- if (ival == (unsigned long)-1 && PyErr_Occurred()) {
- goto exit;
- }
- else {
- c = (unsigned char) ival;
- }
- }
- skip_optional:
- return_value = unsigned_char_converter_impl(module, a, b, c);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(short_converter__doc__,
- "short_converter($module, a=12, /)\n"
- "--\n"
- "\n");
- #define SHORT_CONVERTER_METHODDEF \
- {"short_converter", _PyCFunction_CAST(short_converter), METH_FASTCALL, short_converter__doc__},
- static PyObject *
- short_converter_impl(PyObject *module, short a);
- static PyObject *
- short_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- short a = 12;
- if (!_PyArg_CheckPositional("short_converter", nargs, 0, 1)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- {
- long ival = PyLong_AsLong(args[0]);
- if (ival == -1 && PyErr_Occurred()) {
- goto exit;
- }
- else if (ival < SHRT_MIN) {
- PyErr_SetString(PyExc_OverflowError,
- "signed short integer is less than minimum");
- goto exit;
- }
- else if (ival > SHRT_MAX) {
- PyErr_SetString(PyExc_OverflowError,
- "signed short integer is greater than maximum");
- goto exit;
- }
- else {
- a = (short) ival;
- }
- }
- skip_optional:
- return_value = short_converter_impl(module, a);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(unsigned_short_converter__doc__,
- "unsigned_short_converter($module, a=12, b=34, c=56, /)\n"
- "--\n"
- "\n");
- #define UNSIGNED_SHORT_CONVERTER_METHODDEF \
- {"unsigned_short_converter", _PyCFunction_CAST(unsigned_short_converter), METH_FASTCALL, unsigned_short_converter__doc__},
- static PyObject *
- unsigned_short_converter_impl(PyObject *module, unsigned short a,
- unsigned short b, unsigned short c);
- static PyObject *
- unsigned_short_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- unsigned short a = 12;
- unsigned short b = 34;
- unsigned short c = 56;
- if (!_PyArg_CheckPositional("unsigned_short_converter", nargs, 0, 3)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- if (!_PyLong_UnsignedShort_Converter(args[0], &a)) {
- goto exit;
- }
- if (nargs < 2) {
- goto skip_optional;
- }
- if (!_PyLong_UnsignedShort_Converter(args[1], &b)) {
- goto exit;
- }
- if (nargs < 3) {
- goto skip_optional;
- }
- c = (unsigned short)PyLong_AsUnsignedLongMask(args[2]);
- if (c == (unsigned short)-1 && PyErr_Occurred()) {
- goto exit;
- }
- skip_optional:
- return_value = unsigned_short_converter_impl(module, a, b, c);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(int_converter__doc__,
- "int_converter($module, a=12, b=34, c=45, /)\n"
- "--\n"
- "\n");
- #define INT_CONVERTER_METHODDEF \
- {"int_converter", _PyCFunction_CAST(int_converter), METH_FASTCALL, int_converter__doc__},
- static PyObject *
- int_converter_impl(PyObject *module, int a, int b, int c);
- static PyObject *
- int_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- int a = 12;
- int b = 34;
- int c = 45;
- if (!_PyArg_CheckPositional("int_converter", nargs, 0, 3)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- a = _PyLong_AsInt(args[0]);
- if (a == -1 && PyErr_Occurred()) {
- goto exit;
- }
- if (nargs < 2) {
- goto skip_optional;
- }
- b = _PyLong_AsInt(args[1]);
- if (b == -1 && PyErr_Occurred()) {
- goto exit;
- }
- if (nargs < 3) {
- goto skip_optional;
- }
- if (!PyUnicode_Check(args[2])) {
- _PyArg_BadArgument("int_converter", "argument 3", "a unicode character", args[2]);
- goto exit;
- }
- if (PyUnicode_READY(args[2])) {
- goto exit;
- }
- if (PyUnicode_GET_LENGTH(args[2]) != 1) {
- _PyArg_BadArgument("int_converter", "argument 3", "a unicode character", args[2]);
- goto exit;
- }
- c = PyUnicode_READ_CHAR(args[2], 0);
- skip_optional:
- return_value = int_converter_impl(module, a, b, c);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(unsigned_int_converter__doc__,
- "unsigned_int_converter($module, a=12, b=34, c=56, /)\n"
- "--\n"
- "\n");
- #define UNSIGNED_INT_CONVERTER_METHODDEF \
- {"unsigned_int_converter", _PyCFunction_CAST(unsigned_int_converter), METH_FASTCALL, unsigned_int_converter__doc__},
- static PyObject *
- unsigned_int_converter_impl(PyObject *module, unsigned int a, unsigned int b,
- unsigned int c);
- static PyObject *
- unsigned_int_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- unsigned int a = 12;
- unsigned int b = 34;
- unsigned int c = 56;
- if (!_PyArg_CheckPositional("unsigned_int_converter", nargs, 0, 3)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- if (!_PyLong_UnsignedInt_Converter(args[0], &a)) {
- goto exit;
- }
- if (nargs < 2) {
- goto skip_optional;
- }
- if (!_PyLong_UnsignedInt_Converter(args[1], &b)) {
- goto exit;
- }
- if (nargs < 3) {
- goto skip_optional;
- }
- c = (unsigned int)PyLong_AsUnsignedLongMask(args[2]);
- if (c == (unsigned int)-1 && PyErr_Occurred()) {
- goto exit;
- }
- skip_optional:
- return_value = unsigned_int_converter_impl(module, a, b, c);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(long_converter__doc__,
- "long_converter($module, a=12, /)\n"
- "--\n"
- "\n");
- #define LONG_CONVERTER_METHODDEF \
- {"long_converter", _PyCFunction_CAST(long_converter), METH_FASTCALL, long_converter__doc__},
- static PyObject *
- long_converter_impl(PyObject *module, long a);
- static PyObject *
- long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- long a = 12;
- if (!_PyArg_CheckPositional("long_converter", nargs, 0, 1)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- a = PyLong_AsLong(args[0]);
- if (a == -1 && PyErr_Occurred()) {
- goto exit;
- }
- skip_optional:
- return_value = long_converter_impl(module, a);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(unsigned_long_converter__doc__,
- "unsigned_long_converter($module, a=12, b=34, c=56, /)\n"
- "--\n"
- "\n");
- #define UNSIGNED_LONG_CONVERTER_METHODDEF \
- {"unsigned_long_converter", _PyCFunction_CAST(unsigned_long_converter), METH_FASTCALL, unsigned_long_converter__doc__},
- static PyObject *
- unsigned_long_converter_impl(PyObject *module, unsigned long a,
- unsigned long b, unsigned long c);
- static PyObject *
- unsigned_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- unsigned long a = 12;
- unsigned long b = 34;
- unsigned long c = 56;
- if (!_PyArg_CheckPositional("unsigned_long_converter", nargs, 0, 3)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- if (!_PyLong_UnsignedLong_Converter(args[0], &a)) {
- goto exit;
- }
- if (nargs < 2) {
- goto skip_optional;
- }
- if (!_PyLong_UnsignedLong_Converter(args[1], &b)) {
- goto exit;
- }
- if (nargs < 3) {
- goto skip_optional;
- }
- if (!PyLong_Check(args[2])) {
- _PyArg_BadArgument("unsigned_long_converter", "argument 3", "int", args[2]);
- goto exit;
- }
- c = PyLong_AsUnsignedLongMask(args[2]);
- skip_optional:
- return_value = unsigned_long_converter_impl(module, a, b, c);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(long_long_converter__doc__,
- "long_long_converter($module, a=12, /)\n"
- "--\n"
- "\n");
- #define LONG_LONG_CONVERTER_METHODDEF \
- {"long_long_converter", _PyCFunction_CAST(long_long_converter), METH_FASTCALL, long_long_converter__doc__},
- static PyObject *
- long_long_converter_impl(PyObject *module, long long a);
- static PyObject *
- long_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- long long a = 12;
- if (!_PyArg_CheckPositional("long_long_converter", nargs, 0, 1)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- a = PyLong_AsLongLong(args[0]);
- if (a == -1 && PyErr_Occurred()) {
- goto exit;
- }
- skip_optional:
- return_value = long_long_converter_impl(module, a);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(unsigned_long_long_converter__doc__,
- "unsigned_long_long_converter($module, a=12, b=34, c=56, /)\n"
- "--\n"
- "\n");
- #define UNSIGNED_LONG_LONG_CONVERTER_METHODDEF \
- {"unsigned_long_long_converter", _PyCFunction_CAST(unsigned_long_long_converter), METH_FASTCALL, unsigned_long_long_converter__doc__},
- static PyObject *
- unsigned_long_long_converter_impl(PyObject *module, unsigned long long a,
- unsigned long long b, unsigned long long c);
- static PyObject *
- unsigned_long_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- unsigned long long a = 12;
- unsigned long long b = 34;
- unsigned long long c = 56;
- if (!_PyArg_CheckPositional("unsigned_long_long_converter", nargs, 0, 3)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- if (!_PyLong_UnsignedLongLong_Converter(args[0], &a)) {
- goto exit;
- }
- if (nargs < 2) {
- goto skip_optional;
- }
- if (!_PyLong_UnsignedLongLong_Converter(args[1], &b)) {
- goto exit;
- }
- if (nargs < 3) {
- goto skip_optional;
- }
- if (!PyLong_Check(args[2])) {
- _PyArg_BadArgument("unsigned_long_long_converter", "argument 3", "int", args[2]);
- goto exit;
- }
- c = PyLong_AsUnsignedLongLongMask(args[2]);
- skip_optional:
- return_value = unsigned_long_long_converter_impl(module, a, b, c);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(py_ssize_t_converter__doc__,
- "py_ssize_t_converter($module, a=12, b=34, c=56, /)\n"
- "--\n"
- "\n");
- #define PY_SSIZE_T_CONVERTER_METHODDEF \
- {"py_ssize_t_converter", _PyCFunction_CAST(py_ssize_t_converter), METH_FASTCALL, py_ssize_t_converter__doc__},
- static PyObject *
- py_ssize_t_converter_impl(PyObject *module, Py_ssize_t a, Py_ssize_t b,
- Py_ssize_t c);
- static PyObject *
- py_ssize_t_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- Py_ssize_t a = 12;
- Py_ssize_t b = 34;
- Py_ssize_t c = 56;
- if (!_PyArg_CheckPositional("py_ssize_t_converter", nargs, 0, 3)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- {
- Py_ssize_t ival = -1;
- PyObject *iobj = _PyNumber_Index(args[0]);
- if (iobj != NULL) {
- ival = PyLong_AsSsize_t(iobj);
- Py_DECREF(iobj);
- }
- if (ival == -1 && PyErr_Occurred()) {
- goto exit;
- }
- a = ival;
- }
- if (nargs < 2) {
- goto skip_optional;
- }
- {
- Py_ssize_t ival = -1;
- PyObject *iobj = _PyNumber_Index(args[1]);
- if (iobj != NULL) {
- ival = PyLong_AsSsize_t(iobj);
- Py_DECREF(iobj);
- }
- if (ival == -1 && PyErr_Occurred()) {
- goto exit;
- }
- b = ival;
- }
- if (nargs < 3) {
- goto skip_optional;
- }
- if (!_Py_convert_optional_to_ssize_t(args[2], &c)) {
- goto exit;
- }
- skip_optional:
- return_value = py_ssize_t_converter_impl(module, a, b, c);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(slice_index_converter__doc__,
- "slice_index_converter($module, a=12, b=34, c=56, /)\n"
- "--\n"
- "\n");
- #define SLICE_INDEX_CONVERTER_METHODDEF \
- {"slice_index_converter", _PyCFunction_CAST(slice_index_converter), METH_FASTCALL, slice_index_converter__doc__},
- static PyObject *
- slice_index_converter_impl(PyObject *module, Py_ssize_t a, Py_ssize_t b,
- Py_ssize_t c);
- static PyObject *
- slice_index_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- Py_ssize_t a = 12;
- Py_ssize_t b = 34;
- Py_ssize_t c = 56;
- if (!_PyArg_CheckPositional("slice_index_converter", nargs, 0, 3)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- if (!_PyEval_SliceIndex(args[0], &a)) {
- goto exit;
- }
- if (nargs < 2) {
- goto skip_optional;
- }
- if (!_PyEval_SliceIndexNotNone(args[1], &b)) {
- goto exit;
- }
- if (nargs < 3) {
- goto skip_optional;
- }
- if (!_PyEval_SliceIndex(args[2], &c)) {
- goto exit;
- }
- skip_optional:
- return_value = slice_index_converter_impl(module, a, b, c);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(size_t_converter__doc__,
- "size_t_converter($module, a=12, /)\n"
- "--\n"
- "\n");
- #define SIZE_T_CONVERTER_METHODDEF \
- {"size_t_converter", _PyCFunction_CAST(size_t_converter), METH_FASTCALL, size_t_converter__doc__},
- static PyObject *
- size_t_converter_impl(PyObject *module, size_t a);
- static PyObject *
- size_t_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- size_t a = 12;
- if (!_PyArg_CheckPositional("size_t_converter", nargs, 0, 1)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- if (!_PyLong_Size_t_Converter(args[0], &a)) {
- goto exit;
- }
- skip_optional:
- return_value = size_t_converter_impl(module, a);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(float_converter__doc__,
- "float_converter($module, a=12.5, /)\n"
- "--\n"
- "\n");
- #define FLOAT_CONVERTER_METHODDEF \
- {"float_converter", _PyCFunction_CAST(float_converter), METH_FASTCALL, float_converter__doc__},
- static PyObject *
- float_converter_impl(PyObject *module, float a);
- static PyObject *
- float_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- float a = 12.5;
- if (!_PyArg_CheckPositional("float_converter", nargs, 0, 1)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- if (PyFloat_CheckExact(args[0])) {
- a = (float) (PyFloat_AS_DOUBLE(args[0]));
- }
- else
- {
- a = (float) PyFloat_AsDouble(args[0]);
- if (a == -1.0 && PyErr_Occurred()) {
- goto exit;
- }
- }
- skip_optional:
- return_value = float_converter_impl(module, a);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(double_converter__doc__,
- "double_converter($module, a=12.5, /)\n"
- "--\n"
- "\n");
- #define DOUBLE_CONVERTER_METHODDEF \
- {"double_converter", _PyCFunction_CAST(double_converter), METH_FASTCALL, double_converter__doc__},
- static PyObject *
- double_converter_impl(PyObject *module, double a);
- static PyObject *
- double_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- double a = 12.5;
- if (!_PyArg_CheckPositional("double_converter", nargs, 0, 1)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- if (PyFloat_CheckExact(args[0])) {
- a = PyFloat_AS_DOUBLE(args[0]);
- }
- else
- {
- a = PyFloat_AsDouble(args[0]);
- if (a == -1.0 && PyErr_Occurred()) {
- goto exit;
- }
- }
- skip_optional:
- return_value = double_converter_impl(module, a);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(py_complex_converter__doc__,
- "py_complex_converter($module, a, /)\n"
- "--\n"
- "\n");
- #define PY_COMPLEX_CONVERTER_METHODDEF \
- {"py_complex_converter", (PyCFunction)py_complex_converter, METH_O, py_complex_converter__doc__},
- static PyObject *
- py_complex_converter_impl(PyObject *module, Py_complex a);
- static PyObject *
- py_complex_converter(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- Py_complex a;
- a = PyComplex_AsCComplex(arg);
- if (PyErr_Occurred()) {
- goto exit;
- }
- return_value = py_complex_converter_impl(module, a);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(str_converter__doc__,
- "str_converter($module, a=\'a\', b=\'b\', c=\'c\', /)\n"
- "--\n"
- "\n");
- #define STR_CONVERTER_METHODDEF \
- {"str_converter", _PyCFunction_CAST(str_converter), METH_FASTCALL, str_converter__doc__},
- static PyObject *
- str_converter_impl(PyObject *module, const char *a, const char *b,
- const char *c, Py_ssize_t c_length);
- static PyObject *
- str_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- const char *a = "a";
- const char *b = "b";
- const char *c = "c";
- Py_ssize_t c_length;
- if (!_PyArg_ParseStack(args, nargs, "|sys#:str_converter",
- &a, &b, &c, &c_length)) {
- goto exit;
- }
- return_value = str_converter_impl(module, a, b, c, c_length);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(str_converter_encoding__doc__,
- "str_converter_encoding($module, a, b, c, /)\n"
- "--\n"
- "\n");
- #define STR_CONVERTER_ENCODING_METHODDEF \
- {"str_converter_encoding", _PyCFunction_CAST(str_converter_encoding), METH_FASTCALL, str_converter_encoding__doc__},
- static PyObject *
- str_converter_encoding_impl(PyObject *module, char *a, char *b, char *c,
- Py_ssize_t c_length);
- static PyObject *
- str_converter_encoding(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- char *a = NULL;
- char *b = NULL;
- char *c = NULL;
- Py_ssize_t c_length;
- if (!_PyArg_ParseStack(args, nargs, "esetet#:str_converter_encoding",
- "idna", &a, "idna", &b, "idna", &c, &c_length)) {
- goto exit;
- }
- return_value = str_converter_encoding_impl(module, a, b, c, c_length);
- /* Post parse cleanup for a */
- PyMem_FREE(a);
- /* Post parse cleanup for b */
- PyMem_FREE(b);
- /* Post parse cleanup for c */
- PyMem_FREE(c);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(py_buffer_converter__doc__,
- "py_buffer_converter($module, a, b, /)\n"
- "--\n"
- "\n");
- #define PY_BUFFER_CONVERTER_METHODDEF \
- {"py_buffer_converter", _PyCFunction_CAST(py_buffer_converter), METH_FASTCALL, py_buffer_converter__doc__},
- static PyObject *
- py_buffer_converter_impl(PyObject *module, Py_buffer *a, Py_buffer *b);
- static PyObject *
- py_buffer_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- Py_buffer a = {NULL, NULL};
- Py_buffer b = {NULL, NULL};
- if (!_PyArg_ParseStack(args, nargs, "z*w*:py_buffer_converter",
- &a, &b)) {
- goto exit;
- }
- return_value = py_buffer_converter_impl(module, &a, &b);
- exit:
- /* Cleanup for a */
- if (a.obj) {
- PyBuffer_Release(&a);
- }
- /* Cleanup for b */
- if (b.obj) {
- PyBuffer_Release(&b);
- }
- return return_value;
- }
- PyDoc_STRVAR(keywords__doc__,
- "keywords($module, /, a, b)\n"
- "--\n"
- "\n");
- #define KEYWORDS_METHODDEF \
- {"keywords", _PyCFunction_CAST(keywords), METH_FASTCALL|METH_KEYWORDS, keywords__doc__},
- static PyObject *
- keywords_impl(PyObject *module, PyObject *a, PyObject *b);
- static PyObject *
- keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 2
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('a'), _Py_LATIN1_CHR('b'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"a", "b", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "keywords",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[2];
- PyObject *a;
- PyObject *b;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- b = args[1];
- return_value = keywords_impl(module, a, b);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(keywords_kwonly__doc__,
- "keywords_kwonly($module, /, a, *, b)\n"
- "--\n"
- "\n");
- #define KEYWORDS_KWONLY_METHODDEF \
- {"keywords_kwonly", _PyCFunction_CAST(keywords_kwonly), METH_FASTCALL|METH_KEYWORDS, keywords_kwonly__doc__},
- static PyObject *
- keywords_kwonly_impl(PyObject *module, PyObject *a, PyObject *b);
- static PyObject *
- keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 2
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('a'), _Py_LATIN1_CHR('b'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"a", "b", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "keywords_kwonly",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[2];
- PyObject *a;
- PyObject *b;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 1, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- b = args[1];
- return_value = keywords_kwonly_impl(module, a, b);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(keywords_opt__doc__,
- "keywords_opt($module, /, a, b=None, c=None)\n"
- "--\n"
- "\n");
- #define KEYWORDS_OPT_METHODDEF \
- {"keywords_opt", _PyCFunction_CAST(keywords_opt), METH_FASTCALL|METH_KEYWORDS, keywords_opt__doc__},
- static PyObject *
- keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c);
- static PyObject *
- keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 3
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('a'), _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"a", "b", "c", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "keywords_opt",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[3];
- Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
- PyObject *a;
- PyObject *b = Py_None;
- PyObject *c = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- if (!noptargs) {
- goto skip_optional_pos;
- }
- if (args[1]) {
- b = args[1];
- if (!--noptargs) {
- goto skip_optional_pos;
- }
- }
- c = args[2];
- skip_optional_pos:
- return_value = keywords_opt_impl(module, a, b, c);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(keywords_opt_kwonly__doc__,
- "keywords_opt_kwonly($module, /, a, b=None, *, c=None, d=None)\n"
- "--\n"
- "\n");
- #define KEYWORDS_OPT_KWONLY_METHODDEF \
- {"keywords_opt_kwonly", _PyCFunction_CAST(keywords_opt_kwonly), METH_FASTCALL|METH_KEYWORDS, keywords_opt_kwonly__doc__},
- static PyObject *
- keywords_opt_kwonly_impl(PyObject *module, PyObject *a, PyObject *b,
- PyObject *c, PyObject *d);
- static PyObject *
- keywords_opt_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 4
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('a'), _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), _Py_LATIN1_CHR('d'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"a", "b", "c", "d", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "keywords_opt_kwonly",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[4];
- Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
- PyObject *a;
- PyObject *b = Py_None;
- PyObject *c = Py_None;
- PyObject *d = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- if (!noptargs) {
- goto skip_optional_pos;
- }
- if (args[1]) {
- b = args[1];
- if (!--noptargs) {
- goto skip_optional_pos;
- }
- }
- skip_optional_pos:
- if (!noptargs) {
- goto skip_optional_kwonly;
- }
- if (args[2]) {
- c = args[2];
- if (!--noptargs) {
- goto skip_optional_kwonly;
- }
- }
- d = args[3];
- skip_optional_kwonly:
- return_value = keywords_opt_kwonly_impl(module, a, b, c, d);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(keywords_kwonly_opt__doc__,
- "keywords_kwonly_opt($module, /, a, *, b=None, c=None)\n"
- "--\n"
- "\n");
- #define KEYWORDS_KWONLY_OPT_METHODDEF \
- {"keywords_kwonly_opt", _PyCFunction_CAST(keywords_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, keywords_kwonly_opt__doc__},
- static PyObject *
- keywords_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
- PyObject *c);
- static PyObject *
- keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 3
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('a'), _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"a", "b", "c", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "keywords_kwonly_opt",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[3];
- Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
- PyObject *a;
- PyObject *b = Py_None;
- PyObject *c = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- if (!noptargs) {
- goto skip_optional_kwonly;
- }
- if (args[1]) {
- b = args[1];
- if (!--noptargs) {
- goto skip_optional_kwonly;
- }
- }
- c = args[2];
- skip_optional_kwonly:
- return_value = keywords_kwonly_opt_impl(module, a, b, c);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(posonly_keywords__doc__,
- "posonly_keywords($module, a, /, b)\n"
- "--\n"
- "\n");
- #define POSONLY_KEYWORDS_METHODDEF \
- {"posonly_keywords", _PyCFunction_CAST(posonly_keywords), METH_FASTCALL|METH_KEYWORDS, posonly_keywords__doc__},
- static PyObject *
- posonly_keywords_impl(PyObject *module, PyObject *a, PyObject *b);
- static PyObject *
- posonly_keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 1
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('b'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"", "b", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "posonly_keywords",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[2];
- PyObject *a;
- PyObject *b;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- b = args[1];
- return_value = posonly_keywords_impl(module, a, b);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(posonly_kwonly__doc__,
- "posonly_kwonly($module, a, /, *, b)\n"
- "--\n"
- "\n");
- #define POSONLY_KWONLY_METHODDEF \
- {"posonly_kwonly", _PyCFunction_CAST(posonly_kwonly), METH_FASTCALL|METH_KEYWORDS, posonly_kwonly__doc__},
- static PyObject *
- posonly_kwonly_impl(PyObject *module, PyObject *a, PyObject *b);
- static PyObject *
- posonly_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 1
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('b'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"", "b", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "posonly_kwonly",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[2];
- PyObject *a;
- PyObject *b;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 1, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- b = args[1];
- return_value = posonly_kwonly_impl(module, a, b);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(posonly_keywords_kwonly__doc__,
- "posonly_keywords_kwonly($module, a, /, b, *, c)\n"
- "--\n"
- "\n");
- #define POSONLY_KEYWORDS_KWONLY_METHODDEF \
- {"posonly_keywords_kwonly", _PyCFunction_CAST(posonly_keywords_kwonly), METH_FASTCALL|METH_KEYWORDS, posonly_keywords_kwonly__doc__},
- static PyObject *
- posonly_keywords_kwonly_impl(PyObject *module, PyObject *a, PyObject *b,
- PyObject *c);
- static PyObject *
- posonly_keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 2
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"", "b", "c", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "posonly_keywords_kwonly",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[3];
- PyObject *a;
- PyObject *b;
- PyObject *c;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 1, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- b = args[1];
- c = args[2];
- return_value = posonly_keywords_kwonly_impl(module, a, b, c);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(posonly_keywords_opt__doc__,
- "posonly_keywords_opt($module, a, /, b, c=None, d=None)\n"
- "--\n"
- "\n");
- #define POSONLY_KEYWORDS_OPT_METHODDEF \
- {"posonly_keywords_opt", _PyCFunction_CAST(posonly_keywords_opt), METH_FASTCALL|METH_KEYWORDS, posonly_keywords_opt__doc__},
- static PyObject *
- posonly_keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b,
- PyObject *c, PyObject *d);
- static PyObject *
- posonly_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 3
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), _Py_LATIN1_CHR('d'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"", "b", "c", "d", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "posonly_keywords_opt",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[4];
- Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
- PyObject *a;
- PyObject *b;
- PyObject *c = Py_None;
- PyObject *d = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 4, 0, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- b = args[1];
- if (!noptargs) {
- goto skip_optional_pos;
- }
- if (args[2]) {
- c = args[2];
- if (!--noptargs) {
- goto skip_optional_pos;
- }
- }
- d = args[3];
- skip_optional_pos:
- return_value = posonly_keywords_opt_impl(module, a, b, c, d);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(posonly_opt_keywords_opt__doc__,
- "posonly_opt_keywords_opt($module, a, b=None, /, c=None, d=None)\n"
- "--\n"
- "\n");
- #define POSONLY_OPT_KEYWORDS_OPT_METHODDEF \
- {"posonly_opt_keywords_opt", _PyCFunction_CAST(posonly_opt_keywords_opt), METH_FASTCALL|METH_KEYWORDS, posonly_opt_keywords_opt__doc__},
- static PyObject *
- posonly_opt_keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b,
- PyObject *c, PyObject *d);
- static PyObject *
- posonly_opt_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 2
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('c'), _Py_LATIN1_CHR('d'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"", "", "c", "d", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "posonly_opt_keywords_opt",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[4];
- Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
- PyObject *a;
- PyObject *b = Py_None;
- PyObject *c = Py_None;
- PyObject *d = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 4, 0, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- if (nargs < 2) {
- goto skip_optional_posonly;
- }
- noptargs--;
- b = args[1];
- skip_optional_posonly:
- if (!noptargs) {
- goto skip_optional_pos;
- }
- if (args[2]) {
- c = args[2];
- if (!--noptargs) {
- goto skip_optional_pos;
- }
- }
- d = args[3];
- skip_optional_pos:
- return_value = posonly_opt_keywords_opt_impl(module, a, b, c, d);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(posonly_kwonly_opt__doc__,
- "posonly_kwonly_opt($module, a, /, *, b, c=None, d=None)\n"
- "--\n"
- "\n");
- #define POSONLY_KWONLY_OPT_METHODDEF \
- {"posonly_kwonly_opt", _PyCFunction_CAST(posonly_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_kwonly_opt__doc__},
- static PyObject *
- posonly_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
- PyObject *c, PyObject *d);
- static PyObject *
- posonly_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 3
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), _Py_LATIN1_CHR('d'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"", "b", "c", "d", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "posonly_kwonly_opt",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[4];
- Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
- PyObject *a;
- PyObject *b;
- PyObject *c = Py_None;
- PyObject *d = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 1, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- b = args[1];
- if (!noptargs) {
- goto skip_optional_kwonly;
- }
- if (args[2]) {
- c = args[2];
- if (!--noptargs) {
- goto skip_optional_kwonly;
- }
- }
- d = args[3];
- skip_optional_kwonly:
- return_value = posonly_kwonly_opt_impl(module, a, b, c, d);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(posonly_opt_kwonly_opt__doc__,
- "posonly_opt_kwonly_opt($module, a, b=None, /, *, c=None, d=None)\n"
- "--\n"
- "\n");
- #define POSONLY_OPT_KWONLY_OPT_METHODDEF \
- {"posonly_opt_kwonly_opt", _PyCFunction_CAST(posonly_opt_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_opt_kwonly_opt__doc__},
- static PyObject *
- posonly_opt_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
- PyObject *c, PyObject *d);
- static PyObject *
- posonly_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 2
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('c'), _Py_LATIN1_CHR('d'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"", "", "c", "d", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "posonly_opt_kwonly_opt",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[4];
- Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
- PyObject *a;
- PyObject *b = Py_None;
- PyObject *c = Py_None;
- PyObject *d = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- if (nargs < 2) {
- goto skip_optional_posonly;
- }
- noptargs--;
- b = args[1];
- skip_optional_posonly:
- if (!noptargs) {
- goto skip_optional_kwonly;
- }
- if (args[2]) {
- c = args[2];
- if (!--noptargs) {
- goto skip_optional_kwonly;
- }
- }
- d = args[3];
- skip_optional_kwonly:
- return_value = posonly_opt_kwonly_opt_impl(module, a, b, c, d);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(posonly_keywords_kwonly_opt__doc__,
- "posonly_keywords_kwonly_opt($module, a, /, b, *, c, d=None, e=None)\n"
- "--\n"
- "\n");
- #define POSONLY_KEYWORDS_KWONLY_OPT_METHODDEF \
- {"posonly_keywords_kwonly_opt", _PyCFunction_CAST(posonly_keywords_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_keywords_kwonly_opt__doc__},
- static PyObject *
- posonly_keywords_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
- PyObject *c, PyObject *d, PyObject *e);
- static PyObject *
- posonly_keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 4
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), _Py_LATIN1_CHR('d'), _Py_LATIN1_CHR('e'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"", "b", "c", "d", "e", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "posonly_keywords_kwonly_opt",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[5];
- Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3;
- PyObject *a;
- PyObject *b;
- PyObject *c;
- PyObject *d = Py_None;
- PyObject *e = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 1, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- b = args[1];
- c = args[2];
- if (!noptargs) {
- goto skip_optional_kwonly;
- }
- if (args[3]) {
- d = args[3];
- if (!--noptargs) {
- goto skip_optional_kwonly;
- }
- }
- e = args[4];
- skip_optional_kwonly:
- return_value = posonly_keywords_kwonly_opt_impl(module, a, b, c, d, e);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(posonly_keywords_opt_kwonly_opt__doc__,
- "posonly_keywords_opt_kwonly_opt($module, a, /, b, c=None, *, d=None,\n"
- " e=None)\n"
- "--\n"
- "\n");
- #define POSONLY_KEYWORDS_OPT_KWONLY_OPT_METHODDEF \
- {"posonly_keywords_opt_kwonly_opt", _PyCFunction_CAST(posonly_keywords_opt_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_keywords_opt_kwonly_opt__doc__},
- static PyObject *
- posonly_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a,
- PyObject *b, PyObject *c, PyObject *d,
- PyObject *e);
- static PyObject *
- posonly_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 4
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), _Py_LATIN1_CHR('d'), _Py_LATIN1_CHR('e'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"", "b", "c", "d", "e", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "posonly_keywords_opt_kwonly_opt",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[5];
- Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
- PyObject *a;
- PyObject *b;
- PyObject *c = Py_None;
- PyObject *d = Py_None;
- PyObject *e = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- b = args[1];
- if (!noptargs) {
- goto skip_optional_pos;
- }
- if (args[2]) {
- c = args[2];
- if (!--noptargs) {
- goto skip_optional_pos;
- }
- }
- skip_optional_pos:
- if (!noptargs) {
- goto skip_optional_kwonly;
- }
- if (args[3]) {
- d = args[3];
- if (!--noptargs) {
- goto skip_optional_kwonly;
- }
- }
- e = args[4];
- skip_optional_kwonly:
- return_value = posonly_keywords_opt_kwonly_opt_impl(module, a, b, c, d, e);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(posonly_opt_keywords_opt_kwonly_opt__doc__,
- "posonly_opt_keywords_opt_kwonly_opt($module, a, b=None, /, c=None, *,\n"
- " d=None)\n"
- "--\n"
- "\n");
- #define POSONLY_OPT_KEYWORDS_OPT_KWONLY_OPT_METHODDEF \
- {"posonly_opt_keywords_opt_kwonly_opt", _PyCFunction_CAST(posonly_opt_keywords_opt_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_opt_keywords_opt_kwonly_opt__doc__},
- static PyObject *
- posonly_opt_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a,
- PyObject *b, PyObject *c,
- PyObject *d);
- static PyObject *
- posonly_opt_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 2
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('c'), _Py_LATIN1_CHR('d'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"", "", "c", "d", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "posonly_opt_keywords_opt_kwonly_opt",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[4];
- Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
- PyObject *a;
- PyObject *b = Py_None;
- PyObject *c = Py_None;
- PyObject *d = Py_None;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- if (nargs < 2) {
- goto skip_optional_posonly;
- }
- noptargs--;
- b = args[1];
- skip_optional_posonly:
- if (!noptargs) {
- goto skip_optional_pos;
- }
- if (args[2]) {
- c = args[2];
- if (!--noptargs) {
- goto skip_optional_pos;
- }
- }
- skip_optional_pos:
- if (!noptargs) {
- goto skip_optional_kwonly;
- }
- d = args[3];
- skip_optional_kwonly:
- return_value = posonly_opt_keywords_opt_kwonly_opt_impl(module, a, b, c, d);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(keyword_only_parameter__doc__,
- "keyword_only_parameter($module, /, *, a)\n"
- "--\n"
- "\n");
- #define KEYWORD_ONLY_PARAMETER_METHODDEF \
- {"keyword_only_parameter", _PyCFunction_CAST(keyword_only_parameter), METH_FASTCALL|METH_KEYWORDS, keyword_only_parameter__doc__},
- static PyObject *
- keyword_only_parameter_impl(PyObject *module, PyObject *a);
- static PyObject *
- keyword_only_parameter(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 1
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('a'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"a", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "keyword_only_parameter",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[1];
- PyObject *a;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 1, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- return_value = keyword_only_parameter_impl(module, a);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(posonly_vararg__doc__,
- "posonly_vararg($module, a, /, b, *args)\n"
- "--\n"
- "\n");
- #define POSONLY_VARARG_METHODDEF \
- {"posonly_vararg", _PyCFunction_CAST(posonly_vararg), METH_FASTCALL|METH_KEYWORDS, posonly_vararg__doc__},
- static PyObject *
- posonly_vararg_impl(PyObject *module, PyObject *a, PyObject *b,
- PyObject *args);
- static PyObject *
- posonly_vararg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 1
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('b'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"", "b", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "posonly_vararg",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[3];
- PyObject *a;
- PyObject *b;
- PyObject *__clinic_args = NULL;
- args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, 2, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- b = args[1];
- __clinic_args = args[2];
- return_value = posonly_vararg_impl(module, a, b, __clinic_args);
- exit:
- Py_XDECREF(__clinic_args);
- return return_value;
- }
- PyDoc_STRVAR(vararg_and_posonly__doc__,
- "vararg_and_posonly($module, a, /, *args)\n"
- "--\n"
- "\n");
- #define VARARG_AND_POSONLY_METHODDEF \
- {"vararg_and_posonly", _PyCFunction_CAST(vararg_and_posonly), METH_FASTCALL, vararg_and_posonly__doc__},
- static PyObject *
- vararg_and_posonly_impl(PyObject *module, PyObject *a, PyObject *args);
- static PyObject *
- vararg_and_posonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- PyObject *a;
- PyObject *__clinic_args = NULL;
- if (!_PyArg_CheckPositional("vararg_and_posonly", nargs, 1, PY_SSIZE_T_MAX)) {
- goto exit;
- }
- a = args[0];
- __clinic_args = PyTuple_New(nargs - 1);
- if (!__clinic_args) {
- goto exit;
- }
- for (Py_ssize_t i = 0; i < nargs - 1; ++i) {
- PyTuple_SET_ITEM(__clinic_args, i, Py_NewRef(args[1 + i]));
- }
- return_value = vararg_and_posonly_impl(module, a, __clinic_args);
- exit:
- Py_XDECREF(__clinic_args);
- return return_value;
- }
- PyDoc_STRVAR(vararg__doc__,
- "vararg($module, /, a, *args)\n"
- "--\n"
- "\n");
- #define VARARG_METHODDEF \
- {"vararg", _PyCFunction_CAST(vararg), METH_FASTCALL|METH_KEYWORDS, vararg__doc__},
- static PyObject *
- vararg_impl(PyObject *module, PyObject *a, PyObject *args);
- static PyObject *
- vararg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 1
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('a'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"a", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "vararg",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[2];
- PyObject *a;
- PyObject *__clinic_args = NULL;
- args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, 1, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- __clinic_args = args[1];
- return_value = vararg_impl(module, a, __clinic_args);
- exit:
- Py_XDECREF(__clinic_args);
- return return_value;
- }
- PyDoc_STRVAR(vararg_with_default__doc__,
- "vararg_with_default($module, /, a, *args, b=False)\n"
- "--\n"
- "\n");
- #define VARARG_WITH_DEFAULT_METHODDEF \
- {"vararg_with_default", _PyCFunction_CAST(vararg_with_default), METH_FASTCALL|METH_KEYWORDS, vararg_with_default__doc__},
- static PyObject *
- vararg_with_default_impl(PyObject *module, PyObject *a, PyObject *args,
- int b);
- static PyObject *
- vararg_with_default(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 2
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('a'), _Py_LATIN1_CHR('b'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"a", "b", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "vararg_with_default",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[3];
- Py_ssize_t noptargs = Py_MIN(nargs, 1) + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
- PyObject *a;
- PyObject *__clinic_args = NULL;
- int b = 0;
- args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, 1, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- __clinic_args = args[1];
- if (!noptargs) {
- goto skip_optional_kwonly;
- }
- b = PyObject_IsTrue(args[2]);
- if (b < 0) {
- goto exit;
- }
- skip_optional_kwonly:
- return_value = vararg_with_default_impl(module, a, __clinic_args, b);
- exit:
- Py_XDECREF(__clinic_args);
- return return_value;
- }
- PyDoc_STRVAR(vararg_with_default2__doc__,
- "vararg_with_default2($module, /, a, *args, b=None, c=None)\n"
- "--\n"
- "\n");
- #define VARARG_WITH_DEFAULT2_METHODDEF \
- {"vararg_with_default2", _PyCFunction_CAST(vararg_with_default2), METH_FASTCALL|METH_KEYWORDS, vararg_with_default2__doc__},
- static PyObject *
- vararg_with_default2_impl(PyObject *module, PyObject *a, PyObject *args,
- PyObject *b, PyObject *c);
- static PyObject *
- vararg_with_default2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 3
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('a'), _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"a", "b", "c", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "vararg_with_default2",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[4];
- Py_ssize_t noptargs = Py_MIN(nargs, 1) + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
- PyObject *a;
- PyObject *__clinic_args = NULL;
- PyObject *b = Py_None;
- PyObject *c = Py_None;
- args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, 1, argsbuf);
- if (!args) {
- goto exit;
- }
- a = args[0];
- __clinic_args = args[1];
- if (!noptargs) {
- goto skip_optional_kwonly;
- }
- if (args[2]) {
- b = args[2];
- if (!--noptargs) {
- goto skip_optional_kwonly;
- }
- }
- c = args[3];
- skip_optional_kwonly:
- return_value = vararg_with_default2_impl(module, a, __clinic_args, b, c);
- exit:
- Py_XDECREF(__clinic_args);
- return return_value;
- }
- PyDoc_STRVAR(vararg_with_only_defaults__doc__,
- "vararg_with_only_defaults($module, /, *args, b=None)\n"
- "--\n"
- "\n");
- #define VARARG_WITH_ONLY_DEFAULTS_METHODDEF \
- {"vararg_with_only_defaults", _PyCFunction_CAST(vararg_with_only_defaults), METH_FASTCALL|METH_KEYWORDS, vararg_with_only_defaults__doc__},
- static PyObject *
- vararg_with_only_defaults_impl(PyObject *module, PyObject *args, PyObject *b);
- static PyObject *
- vararg_with_only_defaults(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 1
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { _Py_LATIN1_CHR('b'), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"b", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "vararg_with_only_defaults",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[2];
- Py_ssize_t noptargs = 0 + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
- PyObject *__clinic_args = NULL;
- PyObject *b = Py_None;
- args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, 0, argsbuf);
- if (!args) {
- goto exit;
- }
- __clinic_args = args[0];
- if (!noptargs) {
- goto skip_optional_kwonly;
- }
- b = args[1];
- skip_optional_kwonly:
- return_value = vararg_with_only_defaults_impl(module, __clinic_args, b);
- exit:
- Py_XDECREF(__clinic_args);
- return return_value;
- }
- PyDoc_STRVAR(gh_32092_oob__doc__,
- "gh_32092_oob($module, /, pos1, pos2, *varargs, kw1=None, kw2=None)\n"
- "--\n"
- "\n"
- "Proof-of-concept of GH-32092 OOB bug.");
- #define GH_32092_OOB_METHODDEF \
- {"gh_32092_oob", _PyCFunction_CAST(gh_32092_oob), METH_FASTCALL|METH_KEYWORDS, gh_32092_oob__doc__},
- static PyObject *
- gh_32092_oob_impl(PyObject *module, PyObject *pos1, PyObject *pos2,
- PyObject *varargs, PyObject *kw1, PyObject *kw2);
- static PyObject *
- gh_32092_oob(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 4
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { &_Py_ID(pos1), &_Py_ID(pos2), &_Py_ID(kw1), &_Py_ID(kw2), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"pos1", "pos2", "kw1", "kw2", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "gh_32092_oob",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[5];
- Py_ssize_t noptargs = Py_MIN(nargs, 2) + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
- PyObject *pos1;
- PyObject *pos2;
- PyObject *varargs = NULL;
- PyObject *kw1 = Py_None;
- PyObject *kw2 = Py_None;
- args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, 2, argsbuf);
- if (!args) {
- goto exit;
- }
- pos1 = args[0];
- pos2 = args[1];
- varargs = args[2];
- if (!noptargs) {
- goto skip_optional_kwonly;
- }
- if (args[3]) {
- kw1 = args[3];
- if (!--noptargs) {
- goto skip_optional_kwonly;
- }
- }
- kw2 = args[4];
- skip_optional_kwonly:
- return_value = gh_32092_oob_impl(module, pos1, pos2, varargs, kw1, kw2);
- exit:
- Py_XDECREF(varargs);
- return return_value;
- }
- PyDoc_STRVAR(gh_32092_kw_pass__doc__,
- "gh_32092_kw_pass($module, /, pos, *args, kw=None)\n"
- "--\n"
- "\n"
- "Proof-of-concept of GH-32092 keyword args passing bug.");
- #define GH_32092_KW_PASS_METHODDEF \
- {"gh_32092_kw_pass", _PyCFunction_CAST(gh_32092_kw_pass), METH_FASTCALL|METH_KEYWORDS, gh_32092_kw_pass__doc__},
- static PyObject *
- gh_32092_kw_pass_impl(PyObject *module, PyObject *pos, PyObject *args,
- PyObject *kw);
- static PyObject *
- gh_32092_kw_pass(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 2
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { &_Py_ID(pos), &_Py_ID(kw), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"pos", "kw", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "gh_32092_kw_pass",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[3];
- Py_ssize_t noptargs = Py_MIN(nargs, 1) + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
- PyObject *pos;
- PyObject *__clinic_args = NULL;
- PyObject *kw = Py_None;
- args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, 1, argsbuf);
- if (!args) {
- goto exit;
- }
- pos = args[0];
- __clinic_args = args[1];
- if (!noptargs) {
- goto skip_optional_kwonly;
- }
- kw = args[2];
- skip_optional_kwonly:
- return_value = gh_32092_kw_pass_impl(module, pos, __clinic_args, kw);
- exit:
- Py_XDECREF(__clinic_args);
- return return_value;
- }
- PyDoc_STRVAR(gh_99233_refcount__doc__,
- "gh_99233_refcount($module, /, *args)\n"
- "--\n"
- "\n"
- "Proof-of-concept of GH-99233 refcount error bug.");
- #define GH_99233_REFCOUNT_METHODDEF \
- {"gh_99233_refcount", _PyCFunction_CAST(gh_99233_refcount), METH_FASTCALL, gh_99233_refcount__doc__},
- static PyObject *
- gh_99233_refcount_impl(PyObject *module, PyObject *args);
- static PyObject *
- gh_99233_refcount(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- PyObject *__clinic_args = NULL;
- if (!_PyArg_CheckPositional("gh_99233_refcount", nargs, 0, PY_SSIZE_T_MAX)) {
- goto exit;
- }
- __clinic_args = PyTuple_New(nargs - 0);
- if (!__clinic_args) {
- goto exit;
- }
- for (Py_ssize_t i = 0; i < nargs - 0; ++i) {
- PyTuple_SET_ITEM(__clinic_args, i, Py_NewRef(args[0 + i]));
- }
- return_value = gh_99233_refcount_impl(module, __clinic_args);
- exit:
- Py_XDECREF(__clinic_args);
- return return_value;
- }
- PyDoc_STRVAR(gh_99240_double_free__doc__,
- "gh_99240_double_free($module, a, b, /)\n"
- "--\n"
- "\n"
- "Proof-of-concept of GH-99240 double-free bug.");
- #define GH_99240_DOUBLE_FREE_METHODDEF \
- {"gh_99240_double_free", _PyCFunction_CAST(gh_99240_double_free), METH_FASTCALL, gh_99240_double_free__doc__},
- static PyObject *
- gh_99240_double_free_impl(PyObject *module, char *a, char *b);
- static PyObject *
- gh_99240_double_free(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- char *a = NULL;
- char *b = NULL;
- if (!_PyArg_ParseStack(args, nargs, "eses:gh_99240_double_free",
- "idna", &a, "idna", &b)) {
- goto exit;
- }
- return_value = gh_99240_double_free_impl(module, a, b);
- /* Post parse cleanup for a */
- PyMem_FREE(a);
- /* Post parse cleanup for b */
- PyMem_FREE(b);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(clone_f1__doc__,
- "clone_f1($module, /, path)\n"
- "--\n"
- "\n");
- #define CLONE_F1_METHODDEF \
- {"clone_f1", _PyCFunction_CAST(clone_f1), METH_FASTCALL|METH_KEYWORDS, clone_f1__doc__},
- static PyObject *
- clone_f1_impl(PyObject *module, const char *path);
- static PyObject *
- clone_f1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 1
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { &_Py_ID(path), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"path", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "clone_f1",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[1];
- const char *path;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
- if (!args) {
- goto exit;
- }
- if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("clone_f1", "argument 'path'", "str", args[0]);
- goto exit;
- }
- Py_ssize_t path_length;
- path = PyUnicode_AsUTF8AndSize(args[0], &path_length);
- if (path == NULL) {
- goto exit;
- }
- if (strlen(path) != (size_t)path_length) {
- PyErr_SetString(PyExc_ValueError, "embedded null character");
- goto exit;
- }
- return_value = clone_f1_impl(module, path);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(clone_f2__doc__,
- "clone_f2($module, /, path)\n"
- "--\n"
- "\n");
- #define CLONE_F2_METHODDEF \
- {"clone_f2", _PyCFunction_CAST(clone_f2), METH_FASTCALL|METH_KEYWORDS, clone_f2__doc__},
- static PyObject *
- clone_f2_impl(PyObject *module, const char *path);
- static PyObject *
- clone_f2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 1
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { &_Py_ID(path), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"path", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "clone_f2",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[1];
- const char *path;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
- if (!args) {
- goto exit;
- }
- if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("clone_f2", "argument 'path'", "str", args[0]);
- goto exit;
- }
- Py_ssize_t path_length;
- path = PyUnicode_AsUTF8AndSize(args[0], &path_length);
- if (path == NULL) {
- goto exit;
- }
- if (strlen(path) != (size_t)path_length) {
- PyErr_SetString(PyExc_ValueError, "embedded null character");
- goto exit;
- }
- return_value = clone_f2_impl(module, path);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(clone_with_conv_f1__doc__,
- "clone_with_conv_f1($module, /, path=None)\n"
- "--\n"
- "\n");
- #define CLONE_WITH_CONV_F1_METHODDEF \
- {"clone_with_conv_f1", _PyCFunction_CAST(clone_with_conv_f1), METH_FASTCALL|METH_KEYWORDS, clone_with_conv_f1__doc__},
- static PyObject *
- clone_with_conv_f1_impl(PyObject *module, custom_t path);
- static PyObject *
- clone_with_conv_f1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 1
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { &_Py_ID(path), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"path", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "clone_with_conv_f1",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[1];
- Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
- custom_t path = {
- .name = "clone_with_conv_f1",
- };
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
- if (!args) {
- goto exit;
- }
- if (!noptargs) {
- goto skip_optional_pos;
- }
- if (!custom_converter(args[0], &path)) {
- goto exit;
- }
- skip_optional_pos:
- return_value = clone_with_conv_f1_impl(module, path);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(clone_with_conv_f2__doc__,
- "clone_with_conv_f2($module, /, path=None)\n"
- "--\n"
- "\n");
- #define CLONE_WITH_CONV_F2_METHODDEF \
- {"clone_with_conv_f2", _PyCFunction_CAST(clone_with_conv_f2), METH_FASTCALL|METH_KEYWORDS, clone_with_conv_f2__doc__},
- static PyObject *
- clone_with_conv_f2_impl(PyObject *module, custom_t path);
- static PyObject *
- clone_with_conv_f2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 1
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { &_Py_ID(path), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"path", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "clone_with_conv_f2",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[1];
- Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
- custom_t path = {
- .name = "clone_with_conv_f2",
- };
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
- if (!args) {
- goto exit;
- }
- if (!noptargs) {
- goto skip_optional_pos;
- }
- if (!custom_converter(args[0], &path)) {
- goto exit;
- }
- skip_optional_pos:
- return_value = clone_with_conv_f2_impl(module, path);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_testclinic_TestClass_meth_method_no_params__doc__,
- "meth_method_no_params($self, /)\n"
- "--\n"
- "\n");
- #define _TESTCLINIC_TESTCLASS_METH_METHOD_NO_PARAMS_METHODDEF \
- {"meth_method_no_params", _PyCFunction_CAST(_testclinic_TestClass_meth_method_no_params), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _testclinic_TestClass_meth_method_no_params__doc__},
- static PyObject *
- _testclinic_TestClass_meth_method_no_params_impl(PyObject *self,
- PyTypeObject *cls);
- static PyObject *
- _testclinic_TestClass_meth_method_no_params(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
- PyErr_SetString(PyExc_TypeError, "meth_method_no_params() takes no arguments");
- return NULL;
- }
- return _testclinic_TestClass_meth_method_no_params_impl(self, cls);
- }
- /*[clinic end generated code: output=74fdd265fd402226 input=a9049054013a1b77]*/
|