clinic.test 100 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558
  1. /*[clinic input]
  2. output preset block
  3. [clinic start generated code]*/
  4. /*[clinic end generated code: output=da39a3ee5e6b4b0d input=3c81ac2402d06a8b]*/
  5. /*[clinic input]
  6. test_object_converter
  7. a: object
  8. b: object(converter="PyUnicode_FSConverter")
  9. c: object(subclass_of="&PyUnicode_Type")
  10. d: object(type="PyUnicode_Object *")
  11. /
  12. [clinic start generated code]*/
  13. PyDoc_STRVAR(test_object_converter__doc__,
  14. "test_object_converter($module, a, b, c, d, /)\n"
  15. "--\n"
  16. "\n");
  17. #define TEST_OBJECT_CONVERTER_METHODDEF \
  18. {"test_object_converter", _PyCFunction_CAST(test_object_converter), METH_FASTCALL, test_object_converter__doc__},
  19. static PyObject *
  20. test_object_converter_impl(PyObject *module, PyObject *a, PyObject *b,
  21. PyObject *c, PyUnicode_Object *d);
  22. static PyObject *
  23. test_object_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  24. {
  25. PyObject *return_value = NULL;
  26. PyObject *a;
  27. PyObject *b;
  28. PyObject *c;
  29. PyUnicode_Object *d;
  30. if (!_PyArg_CheckPositional("test_object_converter", nargs, 4, 4)) {
  31. goto exit;
  32. }
  33. a = args[0];
  34. if (!PyUnicode_FSConverter(args[1], &b)) {
  35. goto exit;
  36. }
  37. if (!PyUnicode_Check(args[2])) {
  38. _PyArg_BadArgument("test_object_converter", "argument 3", "str", args[2]);
  39. goto exit;
  40. }
  41. c = args[2];
  42. d = (PyUnicode_Object *)args[3];
  43. return_value = test_object_converter_impl(module, a, b, c, d);
  44. exit:
  45. return return_value;
  46. }
  47. static PyObject *
  48. test_object_converter_impl(PyObject *module, PyObject *a, PyObject *b,
  49. PyObject *c, PyUnicode_Object *d)
  50. /*[clinic end generated code: output=886f4f9b598726b6 input=005e6a8a711a869b]*/
  51. /*[clinic input]
  52. test_object_converter_one_arg
  53. a: object
  54. /
  55. [clinic start generated code]*/
  56. PyDoc_STRVAR(test_object_converter_one_arg__doc__,
  57. "test_object_converter_one_arg($module, a, /)\n"
  58. "--\n"
  59. "\n");
  60. #define TEST_OBJECT_CONVERTER_ONE_ARG_METHODDEF \
  61. {"test_object_converter_one_arg", (PyCFunction)test_object_converter_one_arg, METH_O, test_object_converter_one_arg__doc__},
  62. static PyObject *
  63. test_object_converter_one_arg(PyObject *module, PyObject *a)
  64. /*[clinic end generated code: output=6da755f8502139df input=d635d92a421f1ca3]*/
  65. /*[clinic input]
  66. test_objects_converter
  67. a: object
  68. b: object = NULL
  69. /
  70. [clinic start generated code]*/
  71. PyDoc_STRVAR(test_objects_converter__doc__,
  72. "test_objects_converter($module, a, b=<unrepresentable>, /)\n"
  73. "--\n"
  74. "\n");
  75. #define TEST_OBJECTS_CONVERTER_METHODDEF \
  76. {"test_objects_converter", _PyCFunction_CAST(test_objects_converter), METH_FASTCALL, test_objects_converter__doc__},
  77. static PyObject *
  78. test_objects_converter_impl(PyObject *module, PyObject *a, PyObject *b);
  79. static PyObject *
  80. test_objects_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  81. {
  82. PyObject *return_value = NULL;
  83. PyObject *a;
  84. PyObject *b = NULL;
  85. if (!_PyArg_CheckPositional("test_objects_converter", nargs, 1, 2)) {
  86. goto exit;
  87. }
  88. a = args[0];
  89. if (nargs < 2) {
  90. goto skip_optional;
  91. }
  92. b = args[1];
  93. skip_optional:
  94. return_value = test_objects_converter_impl(module, a, b);
  95. exit:
  96. return return_value;
  97. }
  98. static PyObject *
  99. test_objects_converter_impl(PyObject *module, PyObject *a, PyObject *b)
  100. /*[clinic end generated code: output=fc26328b79d46bb7 input=4cbb3d9edd2a36f3]*/
  101. /*[clinic input]
  102. test_object_converter_subclass_of
  103. a: object(subclass_of="&PyLong_Type")
  104. b: object(subclass_of="&PyTuple_Type")
  105. c: object(subclass_of="&PyList_Type")
  106. d: object(subclass_of="&PySet_Type")
  107. e: object(subclass_of="&PyFrozenSet_Type")
  108. f: object(subclass_of="&PyDict_Type")
  109. g: object(subclass_of="&PyUnicode_Type")
  110. h: object(subclass_of="&PyBytes_Type")
  111. i: object(subclass_of="&PyByteArray_Type")
  112. j: object(subclass_of="&MyType")
  113. /
  114. [clinic start generated code]*/
  115. PyDoc_STRVAR(test_object_converter_subclass_of__doc__,
  116. "test_object_converter_subclass_of($module, a, b, c, d, e, f, g, h, i,\n"
  117. " j, /)\n"
  118. "--\n"
  119. "\n");
  120. #define TEST_OBJECT_CONVERTER_SUBCLASS_OF_METHODDEF \
  121. {"test_object_converter_subclass_of", _PyCFunction_CAST(test_object_converter_subclass_of), METH_FASTCALL, test_object_converter_subclass_of__doc__},
  122. static PyObject *
  123. test_object_converter_subclass_of_impl(PyObject *module, PyObject *a,
  124. PyObject *b, PyObject *c, PyObject *d,
  125. PyObject *e, PyObject *f, PyObject *g,
  126. PyObject *h, PyObject *i, PyObject *j);
  127. static PyObject *
  128. test_object_converter_subclass_of(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  129. {
  130. PyObject *return_value = NULL;
  131. PyObject *a;
  132. PyObject *b;
  133. PyObject *c;
  134. PyObject *d;
  135. PyObject *e;
  136. PyObject *f;
  137. PyObject *g;
  138. PyObject *h;
  139. PyObject *i;
  140. PyObject *j;
  141. if (!_PyArg_CheckPositional("test_object_converter_subclass_of", nargs, 10, 10)) {
  142. goto exit;
  143. }
  144. if (!PyLong_Check(args[0])) {
  145. _PyArg_BadArgument("test_object_converter_subclass_of", "argument 1", "int", args[0]);
  146. goto exit;
  147. }
  148. a = args[0];
  149. if (!PyTuple_Check(args[1])) {
  150. _PyArg_BadArgument("test_object_converter_subclass_of", "argument 2", "tuple", args[1]);
  151. goto exit;
  152. }
  153. b = args[1];
  154. if (!PyList_Check(args[2])) {
  155. _PyArg_BadArgument("test_object_converter_subclass_of", "argument 3", "list", args[2]);
  156. goto exit;
  157. }
  158. c = args[2];
  159. if (!PySet_Check(args[3])) {
  160. _PyArg_BadArgument("test_object_converter_subclass_of", "argument 4", "set", args[3]);
  161. goto exit;
  162. }
  163. d = args[3];
  164. if (!PyFrozenSet_Check(args[4])) {
  165. _PyArg_BadArgument("test_object_converter_subclass_of", "argument 5", "frozenset", args[4]);
  166. goto exit;
  167. }
  168. e = args[4];
  169. if (!PyDict_Check(args[5])) {
  170. _PyArg_BadArgument("test_object_converter_subclass_of", "argument 6", "dict", args[5]);
  171. goto exit;
  172. }
  173. f = args[5];
  174. if (!PyUnicode_Check(args[6])) {
  175. _PyArg_BadArgument("test_object_converter_subclass_of", "argument 7", "str", args[6]);
  176. goto exit;
  177. }
  178. g = args[6];
  179. if (!PyBytes_Check(args[7])) {
  180. _PyArg_BadArgument("test_object_converter_subclass_of", "argument 8", "bytes", args[7]);
  181. goto exit;
  182. }
  183. h = args[7];
  184. if (!PyByteArray_Check(args[8])) {
  185. _PyArg_BadArgument("test_object_converter_subclass_of", "argument 9", "bytearray", args[8]);
  186. goto exit;
  187. }
  188. i = args[8];
  189. if (!PyObject_TypeCheck(args[9], &MyType)) {
  190. _PyArg_BadArgument("test_object_converter_subclass_of", "argument 10", (&MyType)->tp_name, args[9]);
  191. goto exit;
  192. }
  193. j = args[9];
  194. return_value = test_object_converter_subclass_of_impl(module, a, b, c, d, e, f, g, h, i, j);
  195. exit:
  196. return return_value;
  197. }
  198. static PyObject *
  199. test_object_converter_subclass_of_impl(PyObject *module, PyObject *a,
  200. PyObject *b, PyObject *c, PyObject *d,
  201. PyObject *e, PyObject *f, PyObject *g,
  202. PyObject *h, PyObject *i, PyObject *j)
  203. /*[clinic end generated code: output=e4b07c9a54479a40 input=31b06b772d5f983e]*/
  204. /*[clinic input]
  205. test_PyBytesObject_converter
  206. a: PyBytesObject
  207. /
  208. [clinic start generated code]*/
  209. PyDoc_STRVAR(test_PyBytesObject_converter__doc__,
  210. "test_PyBytesObject_converter($module, a, /)\n"
  211. "--\n"
  212. "\n");
  213. #define TEST_PYBYTESOBJECT_CONVERTER_METHODDEF \
  214. {"test_PyBytesObject_converter", (PyCFunction)test_PyBytesObject_converter, METH_O, test_PyBytesObject_converter__doc__},
  215. static PyObject *
  216. test_PyBytesObject_converter_impl(PyObject *module, PyBytesObject *a);
  217. static PyObject *
  218. test_PyBytesObject_converter(PyObject *module, PyObject *arg)
  219. {
  220. PyObject *return_value = NULL;
  221. PyBytesObject *a;
  222. if (!PyBytes_Check(arg)) {
  223. _PyArg_BadArgument("test_PyBytesObject_converter", "argument", "bytes", arg);
  224. goto exit;
  225. }
  226. a = (PyBytesObject *)arg;
  227. return_value = test_PyBytesObject_converter_impl(module, a);
  228. exit:
  229. return return_value;
  230. }
  231. static PyObject *
  232. test_PyBytesObject_converter_impl(PyObject *module, PyBytesObject *a)
  233. /*[clinic end generated code: output=7539d628e6fceace input=12b10c7cb5750400]*/
  234. /*[clinic input]
  235. test_PyByteArrayObject_converter
  236. a: PyByteArrayObject
  237. /
  238. [clinic start generated code]*/
  239. PyDoc_STRVAR(test_PyByteArrayObject_converter__doc__,
  240. "test_PyByteArrayObject_converter($module, a, /)\n"
  241. "--\n"
  242. "\n");
  243. #define TEST_PYBYTEARRAYOBJECT_CONVERTER_METHODDEF \
  244. {"test_PyByteArrayObject_converter", (PyCFunction)test_PyByteArrayObject_converter, METH_O, test_PyByteArrayObject_converter__doc__},
  245. static PyObject *
  246. test_PyByteArrayObject_converter_impl(PyObject *module, PyByteArrayObject *a);
  247. static PyObject *
  248. test_PyByteArrayObject_converter(PyObject *module, PyObject *arg)
  249. {
  250. PyObject *return_value = NULL;
  251. PyByteArrayObject *a;
  252. if (!PyByteArray_Check(arg)) {
  253. _PyArg_BadArgument("test_PyByteArrayObject_converter", "argument", "bytearray", arg);
  254. goto exit;
  255. }
  256. a = (PyByteArrayObject *)arg;
  257. return_value = test_PyByteArrayObject_converter_impl(module, a);
  258. exit:
  259. return return_value;
  260. }
  261. static PyObject *
  262. test_PyByteArrayObject_converter_impl(PyObject *module, PyByteArrayObject *a)
  263. /*[clinic end generated code: output=1245af9f5b3e355e input=5a657da535d194ae]*/
  264. /*[clinic input]
  265. test_unicode_converter
  266. a: unicode
  267. /
  268. [clinic start generated code]*/
  269. PyDoc_STRVAR(test_unicode_converter__doc__,
  270. "test_unicode_converter($module, a, /)\n"
  271. "--\n"
  272. "\n");
  273. #define TEST_UNICODE_CONVERTER_METHODDEF \
  274. {"test_unicode_converter", (PyCFunction)test_unicode_converter, METH_O, test_unicode_converter__doc__},
  275. static PyObject *
  276. test_unicode_converter_impl(PyObject *module, PyObject *a);
  277. static PyObject *
  278. test_unicode_converter(PyObject *module, PyObject *arg)
  279. {
  280. PyObject *return_value = NULL;
  281. PyObject *a;
  282. if (!PyUnicode_Check(arg)) {
  283. _PyArg_BadArgument("test_unicode_converter", "argument", "str", arg);
  284. goto exit;
  285. }
  286. if (PyUnicode_READY(arg) == -1) {
  287. goto exit;
  288. }
  289. a = arg;
  290. return_value = test_unicode_converter_impl(module, a);
  291. exit:
  292. return return_value;
  293. }
  294. static PyObject *
  295. test_unicode_converter_impl(PyObject *module, PyObject *a)
  296. /*[clinic end generated code: output=18f1e3880c862611 input=aa33612df92aa9c5]*/
  297. /*[clinic input]
  298. test_bool_converter
  299. a: bool = True
  300. b: bool(accept={object}) = True
  301. c: bool(accept={int}) = True
  302. /
  303. [clinic start generated code]*/
  304. PyDoc_STRVAR(test_bool_converter__doc__,
  305. "test_bool_converter($module, a=True, b=True, c=True, /)\n"
  306. "--\n"
  307. "\n");
  308. #define TEST_BOOL_CONVERTER_METHODDEF \
  309. {"test_bool_converter", _PyCFunction_CAST(test_bool_converter), METH_FASTCALL, test_bool_converter__doc__},
  310. static PyObject *
  311. test_bool_converter_impl(PyObject *module, int a, int b, int c);
  312. static PyObject *
  313. test_bool_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  314. {
  315. PyObject *return_value = NULL;
  316. int a = 1;
  317. int b = 1;
  318. int c = 1;
  319. if (!_PyArg_CheckPositional("test_bool_converter", nargs, 0, 3)) {
  320. goto exit;
  321. }
  322. if (nargs < 1) {
  323. goto skip_optional;
  324. }
  325. a = PyObject_IsTrue(args[0]);
  326. if (a < 0) {
  327. goto exit;
  328. }
  329. if (nargs < 2) {
  330. goto skip_optional;
  331. }
  332. b = PyObject_IsTrue(args[1]);
  333. if (b < 0) {
  334. goto exit;
  335. }
  336. if (nargs < 3) {
  337. goto skip_optional;
  338. }
  339. c = _PyLong_AsInt(args[2]);
  340. if (c == -1 && PyErr_Occurred()) {
  341. goto exit;
  342. }
  343. skip_optional:
  344. return_value = test_bool_converter_impl(module, a, b, c);
  345. exit:
  346. return return_value;
  347. }
  348. static PyObject *
  349. test_bool_converter_impl(PyObject *module, int a, int b, int c)
  350. /*[clinic end generated code: output=27f0e653a70b9be3 input=939854fa9f248c60]*/
  351. /*[clinic input]
  352. test_char_converter
  353. a: char = b'A'
  354. b: char = b'\a'
  355. c: char = b'\b'
  356. d: char = b'\t'
  357. e: char = b'\n'
  358. f: char = b'\v'
  359. g: char = b'\f'
  360. h: char = b'\r'
  361. i: char = b'"'
  362. j: char = b"'"
  363. k: char = b'?'
  364. l: char = b'\\'
  365. m: char = b'\000'
  366. n: char = b'\377'
  367. /
  368. [clinic start generated code]*/
  369. PyDoc_STRVAR(test_char_converter__doc__,
  370. "test_char_converter($module, a=b\'A\', b=b\'\\x07\', c=b\'\\x08\', d=b\'\\t\',\n"
  371. " e=b\'\\n\', f=b\'\\x0b\', g=b\'\\x0c\', h=b\'\\r\', i=b\'\"\',\n"
  372. " j=b\"\'\", k=b\'?\', l=b\'\\\\\', m=b\'\\x00\', n=b\'\\xff\', /)\n"
  373. "--\n"
  374. "\n");
  375. #define TEST_CHAR_CONVERTER_METHODDEF \
  376. {"test_char_converter", _PyCFunction_CAST(test_char_converter), METH_FASTCALL, test_char_converter__doc__},
  377. static PyObject *
  378. test_char_converter_impl(PyObject *module, char a, char b, char c, char d,
  379. char e, char f, char g, char h, char i, char j,
  380. char k, char l, char m, char n);
  381. static PyObject *
  382. test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  383. {
  384. PyObject *return_value = NULL;
  385. char a = 'A';
  386. char b = '\x07';
  387. char c = '\x08';
  388. char d = '\t';
  389. char e = '\n';
  390. char f = '\x0b';
  391. char g = '\x0c';
  392. char h = '\r';
  393. char i = '"';
  394. char j = '\'';
  395. char k = '?';
  396. char l = '\\';
  397. char m = '\x00';
  398. char n = '\xff';
  399. if (!_PyArg_CheckPositional("test_char_converter", nargs, 0, 14)) {
  400. goto exit;
  401. }
  402. if (nargs < 1) {
  403. goto skip_optional;
  404. }
  405. if (PyBytes_Check(args[0]) && PyBytes_GET_SIZE(args[0]) == 1) {
  406. a = PyBytes_AS_STRING(args[0])[0];
  407. }
  408. else if (PyByteArray_Check(args[0]) && PyByteArray_GET_SIZE(args[0]) == 1) {
  409. a = PyByteArray_AS_STRING(args[0])[0];
  410. }
  411. else {
  412. _PyArg_BadArgument("test_char_converter", "argument 1", "a byte string of length 1", args[0]);
  413. goto exit;
  414. }
  415. if (nargs < 2) {
  416. goto skip_optional;
  417. }
  418. if (PyBytes_Check(args[1]) && PyBytes_GET_SIZE(args[1]) == 1) {
  419. b = PyBytes_AS_STRING(args[1])[0];
  420. }
  421. else if (PyByteArray_Check(args[1]) && PyByteArray_GET_SIZE(args[1]) == 1) {
  422. b = PyByteArray_AS_STRING(args[1])[0];
  423. }
  424. else {
  425. _PyArg_BadArgument("test_char_converter", "argument 2", "a byte string of length 1", args[1]);
  426. goto exit;
  427. }
  428. if (nargs < 3) {
  429. goto skip_optional;
  430. }
  431. if (PyBytes_Check(args[2]) && PyBytes_GET_SIZE(args[2]) == 1) {
  432. c = PyBytes_AS_STRING(args[2])[0];
  433. }
  434. else if (PyByteArray_Check(args[2]) && PyByteArray_GET_SIZE(args[2]) == 1) {
  435. c = PyByteArray_AS_STRING(args[2])[0];
  436. }
  437. else {
  438. _PyArg_BadArgument("test_char_converter", "argument 3", "a byte string of length 1", args[2]);
  439. goto exit;
  440. }
  441. if (nargs < 4) {
  442. goto skip_optional;
  443. }
  444. if (PyBytes_Check(args[3]) && PyBytes_GET_SIZE(args[3]) == 1) {
  445. d = PyBytes_AS_STRING(args[3])[0];
  446. }
  447. else if (PyByteArray_Check(args[3]) && PyByteArray_GET_SIZE(args[3]) == 1) {
  448. d = PyByteArray_AS_STRING(args[3])[0];
  449. }
  450. else {
  451. _PyArg_BadArgument("test_char_converter", "argument 4", "a byte string of length 1", args[3]);
  452. goto exit;
  453. }
  454. if (nargs < 5) {
  455. goto skip_optional;
  456. }
  457. if (PyBytes_Check(args[4]) && PyBytes_GET_SIZE(args[4]) == 1) {
  458. e = PyBytes_AS_STRING(args[4])[0];
  459. }
  460. else if (PyByteArray_Check(args[4]) && PyByteArray_GET_SIZE(args[4]) == 1) {
  461. e = PyByteArray_AS_STRING(args[4])[0];
  462. }
  463. else {
  464. _PyArg_BadArgument("test_char_converter", "argument 5", "a byte string of length 1", args[4]);
  465. goto exit;
  466. }
  467. if (nargs < 6) {
  468. goto skip_optional;
  469. }
  470. if (PyBytes_Check(args[5]) && PyBytes_GET_SIZE(args[5]) == 1) {
  471. f = PyBytes_AS_STRING(args[5])[0];
  472. }
  473. else if (PyByteArray_Check(args[5]) && PyByteArray_GET_SIZE(args[5]) == 1) {
  474. f = PyByteArray_AS_STRING(args[5])[0];
  475. }
  476. else {
  477. _PyArg_BadArgument("test_char_converter", "argument 6", "a byte string of length 1", args[5]);
  478. goto exit;
  479. }
  480. if (nargs < 7) {
  481. goto skip_optional;
  482. }
  483. if (PyBytes_Check(args[6]) && PyBytes_GET_SIZE(args[6]) == 1) {
  484. g = PyBytes_AS_STRING(args[6])[0];
  485. }
  486. else if (PyByteArray_Check(args[6]) && PyByteArray_GET_SIZE(args[6]) == 1) {
  487. g = PyByteArray_AS_STRING(args[6])[0];
  488. }
  489. else {
  490. _PyArg_BadArgument("test_char_converter", "argument 7", "a byte string of length 1", args[6]);
  491. goto exit;
  492. }
  493. if (nargs < 8) {
  494. goto skip_optional;
  495. }
  496. if (PyBytes_Check(args[7]) && PyBytes_GET_SIZE(args[7]) == 1) {
  497. h = PyBytes_AS_STRING(args[7])[0];
  498. }
  499. else if (PyByteArray_Check(args[7]) && PyByteArray_GET_SIZE(args[7]) == 1) {
  500. h = PyByteArray_AS_STRING(args[7])[0];
  501. }
  502. else {
  503. _PyArg_BadArgument("test_char_converter", "argument 8", "a byte string of length 1", args[7]);
  504. goto exit;
  505. }
  506. if (nargs < 9) {
  507. goto skip_optional;
  508. }
  509. if (PyBytes_Check(args[8]) && PyBytes_GET_SIZE(args[8]) == 1) {
  510. i = PyBytes_AS_STRING(args[8])[0];
  511. }
  512. else if (PyByteArray_Check(args[8]) && PyByteArray_GET_SIZE(args[8]) == 1) {
  513. i = PyByteArray_AS_STRING(args[8])[0];
  514. }
  515. else {
  516. _PyArg_BadArgument("test_char_converter", "argument 9", "a byte string of length 1", args[8]);
  517. goto exit;
  518. }
  519. if (nargs < 10) {
  520. goto skip_optional;
  521. }
  522. if (PyBytes_Check(args[9]) && PyBytes_GET_SIZE(args[9]) == 1) {
  523. j = PyBytes_AS_STRING(args[9])[0];
  524. }
  525. else if (PyByteArray_Check(args[9]) && PyByteArray_GET_SIZE(args[9]) == 1) {
  526. j = PyByteArray_AS_STRING(args[9])[0];
  527. }
  528. else {
  529. _PyArg_BadArgument("test_char_converter", "argument 10", "a byte string of length 1", args[9]);
  530. goto exit;
  531. }
  532. if (nargs < 11) {
  533. goto skip_optional;
  534. }
  535. if (PyBytes_Check(args[10]) && PyBytes_GET_SIZE(args[10]) == 1) {
  536. k = PyBytes_AS_STRING(args[10])[0];
  537. }
  538. else if (PyByteArray_Check(args[10]) && PyByteArray_GET_SIZE(args[10]) == 1) {
  539. k = PyByteArray_AS_STRING(args[10])[0];
  540. }
  541. else {
  542. _PyArg_BadArgument("test_char_converter", "argument 11", "a byte string of length 1", args[10]);
  543. goto exit;
  544. }
  545. if (nargs < 12) {
  546. goto skip_optional;
  547. }
  548. if (PyBytes_Check(args[11]) && PyBytes_GET_SIZE(args[11]) == 1) {
  549. l = PyBytes_AS_STRING(args[11])[0];
  550. }
  551. else if (PyByteArray_Check(args[11]) && PyByteArray_GET_SIZE(args[11]) == 1) {
  552. l = PyByteArray_AS_STRING(args[11])[0];
  553. }
  554. else {
  555. _PyArg_BadArgument("test_char_converter", "argument 12", "a byte string of length 1", args[11]);
  556. goto exit;
  557. }
  558. if (nargs < 13) {
  559. goto skip_optional;
  560. }
  561. if (PyBytes_Check(args[12]) && PyBytes_GET_SIZE(args[12]) == 1) {
  562. m = PyBytes_AS_STRING(args[12])[0];
  563. }
  564. else if (PyByteArray_Check(args[12]) && PyByteArray_GET_SIZE(args[12]) == 1) {
  565. m = PyByteArray_AS_STRING(args[12])[0];
  566. }
  567. else {
  568. _PyArg_BadArgument("test_char_converter", "argument 13", "a byte string of length 1", args[12]);
  569. goto exit;
  570. }
  571. if (nargs < 14) {
  572. goto skip_optional;
  573. }
  574. if (PyBytes_Check(args[13]) && PyBytes_GET_SIZE(args[13]) == 1) {
  575. n = PyBytes_AS_STRING(args[13])[0];
  576. }
  577. else if (PyByteArray_Check(args[13]) && PyByteArray_GET_SIZE(args[13]) == 1) {
  578. n = PyByteArray_AS_STRING(args[13])[0];
  579. }
  580. else {
  581. _PyArg_BadArgument("test_char_converter", "argument 14", "a byte string of length 1", args[13]);
  582. goto exit;
  583. }
  584. skip_optional:
  585. return_value = test_char_converter_impl(module, a, b, c, d, e, f, g, h, i, j, k, l, m, n);
  586. exit:
  587. return return_value;
  588. }
  589. static PyObject *
  590. test_char_converter_impl(PyObject *module, char a, char b, char c, char d,
  591. char e, char f, char g, char h, char i, char j,
  592. char k, char l, char m, char n)
  593. /*[clinic end generated code: output=98589f02422fe6b1 input=e42330417a44feac]*/
  594. /*[clinic input]
  595. test_unsigned_char_converter
  596. a: unsigned_char = 12
  597. b: unsigned_char(bitwise=False) = 34
  598. c: unsigned_char(bitwise=True) = 56
  599. /
  600. [clinic start generated code]*/
  601. PyDoc_STRVAR(test_unsigned_char_converter__doc__,
  602. "test_unsigned_char_converter($module, a=12, b=34, c=56, /)\n"
  603. "--\n"
  604. "\n");
  605. #define TEST_UNSIGNED_CHAR_CONVERTER_METHODDEF \
  606. {"test_unsigned_char_converter", _PyCFunction_CAST(test_unsigned_char_converter), METH_FASTCALL, test_unsigned_char_converter__doc__},
  607. static PyObject *
  608. test_unsigned_char_converter_impl(PyObject *module, unsigned char a,
  609. unsigned char b, unsigned char c);
  610. static PyObject *
  611. test_unsigned_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  612. {
  613. PyObject *return_value = NULL;
  614. unsigned char a = 12;
  615. unsigned char b = 34;
  616. unsigned char c = 56;
  617. if (!_PyArg_CheckPositional("test_unsigned_char_converter", nargs, 0, 3)) {
  618. goto exit;
  619. }
  620. if (nargs < 1) {
  621. goto skip_optional;
  622. }
  623. {
  624. long ival = PyLong_AsLong(args[0]);
  625. if (ival == -1 && PyErr_Occurred()) {
  626. goto exit;
  627. }
  628. else if (ival < 0) {
  629. PyErr_SetString(PyExc_OverflowError,
  630. "unsigned byte integer is less than minimum");
  631. goto exit;
  632. }
  633. else if (ival > UCHAR_MAX) {
  634. PyErr_SetString(PyExc_OverflowError,
  635. "unsigned byte integer is greater than maximum");
  636. goto exit;
  637. }
  638. else {
  639. a = (unsigned char) ival;
  640. }
  641. }
  642. if (nargs < 2) {
  643. goto skip_optional;
  644. }
  645. {
  646. long ival = PyLong_AsLong(args[1]);
  647. if (ival == -1 && PyErr_Occurred()) {
  648. goto exit;
  649. }
  650. else if (ival < 0) {
  651. PyErr_SetString(PyExc_OverflowError,
  652. "unsigned byte integer is less than minimum");
  653. goto exit;
  654. }
  655. else if (ival > UCHAR_MAX) {
  656. PyErr_SetString(PyExc_OverflowError,
  657. "unsigned byte integer is greater than maximum");
  658. goto exit;
  659. }
  660. else {
  661. b = (unsigned char) ival;
  662. }
  663. }
  664. if (nargs < 3) {
  665. goto skip_optional;
  666. }
  667. {
  668. unsigned long ival = PyLong_AsUnsignedLongMask(args[2]);
  669. if (ival == (unsigned long)-1 && PyErr_Occurred()) {
  670. goto exit;
  671. }
  672. else {
  673. c = (unsigned char) ival;
  674. }
  675. }
  676. skip_optional:
  677. return_value = test_unsigned_char_converter_impl(module, a, b, c);
  678. exit:
  679. return return_value;
  680. }
  681. static PyObject *
  682. test_unsigned_char_converter_impl(PyObject *module, unsigned char a,
  683. unsigned char b, unsigned char c)
  684. /*[clinic end generated code: output=45920dbedc22eb55 input=021414060993e289]*/
  685. /*[clinic input]
  686. test_short_converter
  687. a: short = 12
  688. /
  689. [clinic start generated code]*/
  690. PyDoc_STRVAR(test_short_converter__doc__,
  691. "test_short_converter($module, a=12, /)\n"
  692. "--\n"
  693. "\n");
  694. #define TEST_SHORT_CONVERTER_METHODDEF \
  695. {"test_short_converter", _PyCFunction_CAST(test_short_converter), METH_FASTCALL, test_short_converter__doc__},
  696. static PyObject *
  697. test_short_converter_impl(PyObject *module, short a);
  698. static PyObject *
  699. test_short_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  700. {
  701. PyObject *return_value = NULL;
  702. short a = 12;
  703. if (!_PyArg_CheckPositional("test_short_converter", nargs, 0, 1)) {
  704. goto exit;
  705. }
  706. if (nargs < 1) {
  707. goto skip_optional;
  708. }
  709. {
  710. long ival = PyLong_AsLong(args[0]);
  711. if (ival == -1 && PyErr_Occurred()) {
  712. goto exit;
  713. }
  714. else if (ival < SHRT_MIN) {
  715. PyErr_SetString(PyExc_OverflowError,
  716. "signed short integer is less than minimum");
  717. goto exit;
  718. }
  719. else if (ival > SHRT_MAX) {
  720. PyErr_SetString(PyExc_OverflowError,
  721. "signed short integer is greater than maximum");
  722. goto exit;
  723. }
  724. else {
  725. a = (short) ival;
  726. }
  727. }
  728. skip_optional:
  729. return_value = test_short_converter_impl(module, a);
  730. exit:
  731. return return_value;
  732. }
  733. static PyObject *
  734. test_short_converter_impl(PyObject *module, short a)
  735. /*[clinic end generated code: output=a580945bd6963d45 input=6a8a7a509a498ff4]*/
  736. /*[clinic input]
  737. test_unsigned_short_converter
  738. a: unsigned_short = 12
  739. b: unsigned_short(bitwise=False) = 34
  740. c: unsigned_short(bitwise=True) = 56
  741. /
  742. [clinic start generated code]*/
  743. PyDoc_STRVAR(test_unsigned_short_converter__doc__,
  744. "test_unsigned_short_converter($module, a=12, b=34, c=56, /)\n"
  745. "--\n"
  746. "\n");
  747. #define TEST_UNSIGNED_SHORT_CONVERTER_METHODDEF \
  748. {"test_unsigned_short_converter", _PyCFunction_CAST(test_unsigned_short_converter), METH_FASTCALL, test_unsigned_short_converter__doc__},
  749. static PyObject *
  750. test_unsigned_short_converter_impl(PyObject *module, unsigned short a,
  751. unsigned short b, unsigned short c);
  752. static PyObject *
  753. test_unsigned_short_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  754. {
  755. PyObject *return_value = NULL;
  756. unsigned short a = 12;
  757. unsigned short b = 34;
  758. unsigned short c = 56;
  759. if (!_PyArg_CheckPositional("test_unsigned_short_converter", nargs, 0, 3)) {
  760. goto exit;
  761. }
  762. if (nargs < 1) {
  763. goto skip_optional;
  764. }
  765. if (!_PyLong_UnsignedShort_Converter(args[0], &a)) {
  766. goto exit;
  767. }
  768. if (nargs < 2) {
  769. goto skip_optional;
  770. }
  771. if (!_PyLong_UnsignedShort_Converter(args[1], &b)) {
  772. goto exit;
  773. }
  774. if (nargs < 3) {
  775. goto skip_optional;
  776. }
  777. c = (unsigned short)PyLong_AsUnsignedLongMask(args[2]);
  778. if (c == (unsigned short)-1 && PyErr_Occurred()) {
  779. goto exit;
  780. }
  781. skip_optional:
  782. return_value = test_unsigned_short_converter_impl(module, a, b, c);
  783. exit:
  784. return return_value;
  785. }
  786. static PyObject *
  787. test_unsigned_short_converter_impl(PyObject *module, unsigned short a,
  788. unsigned short b, unsigned short c)
  789. /*[clinic end generated code: output=e6e990df729114fc input=cdfd8eff3d9176b4]*/
  790. /*[clinic input]
  791. test_int_converter
  792. a: int = 12
  793. b: int(accept={int}) = 34
  794. c: int(accept={str}) = 45
  795. d: int(type='myenum') = 67
  796. /
  797. [clinic start generated code]*/
  798. PyDoc_STRVAR(test_int_converter__doc__,
  799. "test_int_converter($module, a=12, b=34, c=45, d=67, /)\n"
  800. "--\n"
  801. "\n");
  802. #define TEST_INT_CONVERTER_METHODDEF \
  803. {"test_int_converter", _PyCFunction_CAST(test_int_converter), METH_FASTCALL, test_int_converter__doc__},
  804. static PyObject *
  805. test_int_converter_impl(PyObject *module, int a, int b, int c, myenum d);
  806. static PyObject *
  807. test_int_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  808. {
  809. PyObject *return_value = NULL;
  810. int a = 12;
  811. int b = 34;
  812. int c = 45;
  813. myenum d = 67;
  814. if (!_PyArg_CheckPositional("test_int_converter", nargs, 0, 4)) {
  815. goto exit;
  816. }
  817. if (nargs < 1) {
  818. goto skip_optional;
  819. }
  820. a = _PyLong_AsInt(args[0]);
  821. if (a == -1 && PyErr_Occurred()) {
  822. goto exit;
  823. }
  824. if (nargs < 2) {
  825. goto skip_optional;
  826. }
  827. b = _PyLong_AsInt(args[1]);
  828. if (b == -1 && PyErr_Occurred()) {
  829. goto exit;
  830. }
  831. if (nargs < 3) {
  832. goto skip_optional;
  833. }
  834. if (!PyUnicode_Check(args[2])) {
  835. _PyArg_BadArgument("test_int_converter", "argument 3", "a unicode character", args[2]);
  836. goto exit;
  837. }
  838. if (PyUnicode_READY(args[2])) {
  839. goto exit;
  840. }
  841. if (PyUnicode_GET_LENGTH(args[2]) != 1) {
  842. _PyArg_BadArgument("test_int_converter", "argument 3", "a unicode character", args[2]);
  843. goto exit;
  844. }
  845. c = PyUnicode_READ_CHAR(args[2], 0);
  846. if (nargs < 4) {
  847. goto skip_optional;
  848. }
  849. d = _PyLong_AsInt(args[3]);
  850. if (d == -1 && PyErr_Occurred()) {
  851. goto exit;
  852. }
  853. skip_optional:
  854. return_value = test_int_converter_impl(module, a, b, c, d);
  855. exit:
  856. return return_value;
  857. }
  858. static PyObject *
  859. test_int_converter_impl(PyObject *module, int a, int b, int c, myenum d)
  860. /*[clinic end generated code: output=800993036e078c07 input=d20541fc1ca0553e]*/
  861. /*[clinic input]
  862. test_unsigned_int_converter
  863. a: unsigned_int = 12
  864. b: unsigned_int(bitwise=False) = 34
  865. c: unsigned_int(bitwise=True) = 56
  866. /
  867. [clinic start generated code]*/
  868. PyDoc_STRVAR(test_unsigned_int_converter__doc__,
  869. "test_unsigned_int_converter($module, a=12, b=34, c=56, /)\n"
  870. "--\n"
  871. "\n");
  872. #define TEST_UNSIGNED_INT_CONVERTER_METHODDEF \
  873. {"test_unsigned_int_converter", _PyCFunction_CAST(test_unsigned_int_converter), METH_FASTCALL, test_unsigned_int_converter__doc__},
  874. static PyObject *
  875. test_unsigned_int_converter_impl(PyObject *module, unsigned int a,
  876. unsigned int b, unsigned int c);
  877. static PyObject *
  878. test_unsigned_int_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  879. {
  880. PyObject *return_value = NULL;
  881. unsigned int a = 12;
  882. unsigned int b = 34;
  883. unsigned int c = 56;
  884. if (!_PyArg_CheckPositional("test_unsigned_int_converter", nargs, 0, 3)) {
  885. goto exit;
  886. }
  887. if (nargs < 1) {
  888. goto skip_optional;
  889. }
  890. if (!_PyLong_UnsignedInt_Converter(args[0], &a)) {
  891. goto exit;
  892. }
  893. if (nargs < 2) {
  894. goto skip_optional;
  895. }
  896. if (!_PyLong_UnsignedInt_Converter(args[1], &b)) {
  897. goto exit;
  898. }
  899. if (nargs < 3) {
  900. goto skip_optional;
  901. }
  902. c = (unsigned int)PyLong_AsUnsignedLongMask(args[2]);
  903. if (c == (unsigned int)-1 && PyErr_Occurred()) {
  904. goto exit;
  905. }
  906. skip_optional:
  907. return_value = test_unsigned_int_converter_impl(module, a, b, c);
  908. exit:
  909. return return_value;
  910. }
  911. static PyObject *
  912. test_unsigned_int_converter_impl(PyObject *module, unsigned int a,
  913. unsigned int b, unsigned int c)
  914. /*[clinic end generated code: output=f9cdbe410ccc98a3 input=5533534828b62fc0]*/
  915. /*[clinic input]
  916. test_long_converter
  917. a: long = 12
  918. /
  919. [clinic start generated code]*/
  920. PyDoc_STRVAR(test_long_converter__doc__,
  921. "test_long_converter($module, a=12, /)\n"
  922. "--\n"
  923. "\n");
  924. #define TEST_LONG_CONVERTER_METHODDEF \
  925. {"test_long_converter", _PyCFunction_CAST(test_long_converter), METH_FASTCALL, test_long_converter__doc__},
  926. static PyObject *
  927. test_long_converter_impl(PyObject *module, long a);
  928. static PyObject *
  929. test_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  930. {
  931. PyObject *return_value = NULL;
  932. long a = 12;
  933. if (!_PyArg_CheckPositional("test_long_converter", nargs, 0, 1)) {
  934. goto exit;
  935. }
  936. if (nargs < 1) {
  937. goto skip_optional;
  938. }
  939. a = PyLong_AsLong(args[0]);
  940. if (a == -1 && PyErr_Occurred()) {
  941. goto exit;
  942. }
  943. skip_optional:
  944. return_value = test_long_converter_impl(module, a);
  945. exit:
  946. return return_value;
  947. }
  948. static PyObject *
  949. test_long_converter_impl(PyObject *module, long a)
  950. /*[clinic end generated code: output=02b3a83495c1d236 input=d2179e3c9cdcde89]*/
  951. /*[clinic input]
  952. test_unsigned_long_converter
  953. a: unsigned_long = 12
  954. b: unsigned_long(bitwise=False) = 34
  955. c: unsigned_long(bitwise=True) = 56
  956. /
  957. [clinic start generated code]*/
  958. PyDoc_STRVAR(test_unsigned_long_converter__doc__,
  959. "test_unsigned_long_converter($module, a=12, b=34, c=56, /)\n"
  960. "--\n"
  961. "\n");
  962. #define TEST_UNSIGNED_LONG_CONVERTER_METHODDEF \
  963. {"test_unsigned_long_converter", _PyCFunction_CAST(test_unsigned_long_converter), METH_FASTCALL, test_unsigned_long_converter__doc__},
  964. static PyObject *
  965. test_unsigned_long_converter_impl(PyObject *module, unsigned long a,
  966. unsigned long b, unsigned long c);
  967. static PyObject *
  968. test_unsigned_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  969. {
  970. PyObject *return_value = NULL;
  971. unsigned long a = 12;
  972. unsigned long b = 34;
  973. unsigned long c = 56;
  974. if (!_PyArg_CheckPositional("test_unsigned_long_converter", nargs, 0, 3)) {
  975. goto exit;
  976. }
  977. if (nargs < 1) {
  978. goto skip_optional;
  979. }
  980. if (!_PyLong_UnsignedLong_Converter(args[0], &a)) {
  981. goto exit;
  982. }
  983. if (nargs < 2) {
  984. goto skip_optional;
  985. }
  986. if (!_PyLong_UnsignedLong_Converter(args[1], &b)) {
  987. goto exit;
  988. }
  989. if (nargs < 3) {
  990. goto skip_optional;
  991. }
  992. if (!PyLong_Check(args[2])) {
  993. _PyArg_BadArgument("test_unsigned_long_converter", "argument 3", "int", args[2]);
  994. goto exit;
  995. }
  996. c = PyLong_AsUnsignedLongMask(args[2]);
  997. skip_optional:
  998. return_value = test_unsigned_long_converter_impl(module, a, b, c);
  999. exit:
  1000. return return_value;
  1001. }
  1002. static PyObject *
  1003. test_unsigned_long_converter_impl(PyObject *module, unsigned long a,
  1004. unsigned long b, unsigned long c)
  1005. /*[clinic end generated code: output=540bb0ba2894e1fe input=f450d94cae1ef73b]*/
  1006. /*[clinic input]
  1007. test_long_long_converter
  1008. a: long_long = 12
  1009. /
  1010. [clinic start generated code]*/
  1011. PyDoc_STRVAR(test_long_long_converter__doc__,
  1012. "test_long_long_converter($module, a=12, /)\n"
  1013. "--\n"
  1014. "\n");
  1015. #define TEST_LONG_LONG_CONVERTER_METHODDEF \
  1016. {"test_long_long_converter", _PyCFunction_CAST(test_long_long_converter), METH_FASTCALL, test_long_long_converter__doc__},
  1017. static PyObject *
  1018. test_long_long_converter_impl(PyObject *module, long long a);
  1019. static PyObject *
  1020. test_long_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  1021. {
  1022. PyObject *return_value = NULL;
  1023. long long a = 12;
  1024. if (!_PyArg_CheckPositional("test_long_long_converter", nargs, 0, 1)) {
  1025. goto exit;
  1026. }
  1027. if (nargs < 1) {
  1028. goto skip_optional;
  1029. }
  1030. a = PyLong_AsLongLong(args[0]);
  1031. if (a == -1 && PyErr_Occurred()) {
  1032. goto exit;
  1033. }
  1034. skip_optional:
  1035. return_value = test_long_long_converter_impl(module, a);
  1036. exit:
  1037. return return_value;
  1038. }
  1039. static PyObject *
  1040. test_long_long_converter_impl(PyObject *module, long long a)
  1041. /*[clinic end generated code: output=f9d4ed79ad2db857 input=d5fc81577ff4dd02]*/
  1042. /*[clinic input]
  1043. test_unsigned_long_long_converter
  1044. a: unsigned_long_long = 12
  1045. b: unsigned_long_long(bitwise=False) = 34
  1046. c: unsigned_long_long(bitwise=True) = 56
  1047. /
  1048. [clinic start generated code]*/
  1049. PyDoc_STRVAR(test_unsigned_long_long_converter__doc__,
  1050. "test_unsigned_long_long_converter($module, a=12, b=34, c=56, /)\n"
  1051. "--\n"
  1052. "\n");
  1053. #define TEST_UNSIGNED_LONG_LONG_CONVERTER_METHODDEF \
  1054. {"test_unsigned_long_long_converter", _PyCFunction_CAST(test_unsigned_long_long_converter), METH_FASTCALL, test_unsigned_long_long_converter__doc__},
  1055. static PyObject *
  1056. test_unsigned_long_long_converter_impl(PyObject *module,
  1057. unsigned long long a,
  1058. unsigned long long b,
  1059. unsigned long long c);
  1060. static PyObject *
  1061. test_unsigned_long_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  1062. {
  1063. PyObject *return_value = NULL;
  1064. unsigned long long a = 12;
  1065. unsigned long long b = 34;
  1066. unsigned long long c = 56;
  1067. if (!_PyArg_CheckPositional("test_unsigned_long_long_converter", nargs, 0, 3)) {
  1068. goto exit;
  1069. }
  1070. if (nargs < 1) {
  1071. goto skip_optional;
  1072. }
  1073. if (!_PyLong_UnsignedLongLong_Converter(args[0], &a)) {
  1074. goto exit;
  1075. }
  1076. if (nargs < 2) {
  1077. goto skip_optional;
  1078. }
  1079. if (!_PyLong_UnsignedLongLong_Converter(args[1], &b)) {
  1080. goto exit;
  1081. }
  1082. if (nargs < 3) {
  1083. goto skip_optional;
  1084. }
  1085. if (!PyLong_Check(args[2])) {
  1086. _PyArg_BadArgument("test_unsigned_long_long_converter", "argument 3", "int", args[2]);
  1087. goto exit;
  1088. }
  1089. c = PyLong_AsUnsignedLongLongMask(args[2]);
  1090. skip_optional:
  1091. return_value = test_unsigned_long_long_converter_impl(module, a, b, c);
  1092. exit:
  1093. return return_value;
  1094. }
  1095. static PyObject *
  1096. test_unsigned_long_long_converter_impl(PyObject *module,
  1097. unsigned long long a,
  1098. unsigned long long b,
  1099. unsigned long long c)
  1100. /*[clinic end generated code: output=3d69994f618b46bb input=a15115dc41866ff4]*/
  1101. /*[clinic input]
  1102. test_Py_ssize_t_converter
  1103. a: Py_ssize_t = 12
  1104. b: Py_ssize_t(accept={int}) = 34
  1105. c: Py_ssize_t(accept={int, NoneType}) = 56
  1106. /
  1107. [clinic start generated code]*/
  1108. PyDoc_STRVAR(test_Py_ssize_t_converter__doc__,
  1109. "test_Py_ssize_t_converter($module, a=12, b=34, c=56, /)\n"
  1110. "--\n"
  1111. "\n");
  1112. #define TEST_PY_SSIZE_T_CONVERTER_METHODDEF \
  1113. {"test_Py_ssize_t_converter", _PyCFunction_CAST(test_Py_ssize_t_converter), METH_FASTCALL, test_Py_ssize_t_converter__doc__},
  1114. static PyObject *
  1115. test_Py_ssize_t_converter_impl(PyObject *module, Py_ssize_t a, Py_ssize_t b,
  1116. Py_ssize_t c);
  1117. static PyObject *
  1118. test_Py_ssize_t_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  1119. {
  1120. PyObject *return_value = NULL;
  1121. Py_ssize_t a = 12;
  1122. Py_ssize_t b = 34;
  1123. Py_ssize_t c = 56;
  1124. if (!_PyArg_CheckPositional("test_Py_ssize_t_converter", nargs, 0, 3)) {
  1125. goto exit;
  1126. }
  1127. if (nargs < 1) {
  1128. goto skip_optional;
  1129. }
  1130. {
  1131. Py_ssize_t ival = -1;
  1132. PyObject *iobj = _PyNumber_Index(args[0]);
  1133. if (iobj != NULL) {
  1134. ival = PyLong_AsSsize_t(iobj);
  1135. Py_DECREF(iobj);
  1136. }
  1137. if (ival == -1 && PyErr_Occurred()) {
  1138. goto exit;
  1139. }
  1140. a = ival;
  1141. }
  1142. if (nargs < 2) {
  1143. goto skip_optional;
  1144. }
  1145. {
  1146. Py_ssize_t ival = -1;
  1147. PyObject *iobj = _PyNumber_Index(args[1]);
  1148. if (iobj != NULL) {
  1149. ival = PyLong_AsSsize_t(iobj);
  1150. Py_DECREF(iobj);
  1151. }
  1152. if (ival == -1 && PyErr_Occurred()) {
  1153. goto exit;
  1154. }
  1155. b = ival;
  1156. }
  1157. if (nargs < 3) {
  1158. goto skip_optional;
  1159. }
  1160. if (!_Py_convert_optional_to_ssize_t(args[2], &c)) {
  1161. goto exit;
  1162. }
  1163. skip_optional:
  1164. return_value = test_Py_ssize_t_converter_impl(module, a, b, c);
  1165. exit:
  1166. return return_value;
  1167. }
  1168. static PyObject *
  1169. test_Py_ssize_t_converter_impl(PyObject *module, Py_ssize_t a, Py_ssize_t b,
  1170. Py_ssize_t c)
  1171. /*[clinic end generated code: output=48214bc3d01f4dd7 input=3855f184bb3f299d]*/
  1172. /*[clinic input]
  1173. test_slice_index_converter
  1174. a: slice_index = 12
  1175. b: slice_index(accept={int}) = 34
  1176. c: slice_index(accept={int, NoneType}) = 56
  1177. /
  1178. [clinic start generated code]*/
  1179. PyDoc_STRVAR(test_slice_index_converter__doc__,
  1180. "test_slice_index_converter($module, a=12, b=34, c=56, /)\n"
  1181. "--\n"
  1182. "\n");
  1183. #define TEST_SLICE_INDEX_CONVERTER_METHODDEF \
  1184. {"test_slice_index_converter", _PyCFunction_CAST(test_slice_index_converter), METH_FASTCALL, test_slice_index_converter__doc__},
  1185. static PyObject *
  1186. test_slice_index_converter_impl(PyObject *module, Py_ssize_t a, Py_ssize_t b,
  1187. Py_ssize_t c);
  1188. static PyObject *
  1189. test_slice_index_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  1190. {
  1191. PyObject *return_value = NULL;
  1192. Py_ssize_t a = 12;
  1193. Py_ssize_t b = 34;
  1194. Py_ssize_t c = 56;
  1195. if (!_PyArg_CheckPositional("test_slice_index_converter", nargs, 0, 3)) {
  1196. goto exit;
  1197. }
  1198. if (nargs < 1) {
  1199. goto skip_optional;
  1200. }
  1201. if (!_PyEval_SliceIndex(args[0], &a)) {
  1202. goto exit;
  1203. }
  1204. if (nargs < 2) {
  1205. goto skip_optional;
  1206. }
  1207. if (!_PyEval_SliceIndexNotNone(args[1], &b)) {
  1208. goto exit;
  1209. }
  1210. if (nargs < 3) {
  1211. goto skip_optional;
  1212. }
  1213. if (!_PyEval_SliceIndex(args[2], &c)) {
  1214. goto exit;
  1215. }
  1216. skip_optional:
  1217. return_value = test_slice_index_converter_impl(module, a, b, c);
  1218. exit:
  1219. return return_value;
  1220. }
  1221. static PyObject *
  1222. test_slice_index_converter_impl(PyObject *module, Py_ssize_t a, Py_ssize_t b,
  1223. Py_ssize_t c)
  1224. /*[clinic end generated code: output=67506ed999361212 input=edeadb0ee126f531]*/
  1225. /*[clinic input]
  1226. test_size_t_converter
  1227. a: size_t = 12
  1228. /
  1229. [clinic start generated code]*/
  1230. PyDoc_STRVAR(test_size_t_converter__doc__,
  1231. "test_size_t_converter($module, a=12, /)\n"
  1232. "--\n"
  1233. "\n");
  1234. #define TEST_SIZE_T_CONVERTER_METHODDEF \
  1235. {"test_size_t_converter", _PyCFunction_CAST(test_size_t_converter), METH_FASTCALL, test_size_t_converter__doc__},
  1236. static PyObject *
  1237. test_size_t_converter_impl(PyObject *module, size_t a);
  1238. static PyObject *
  1239. test_size_t_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  1240. {
  1241. PyObject *return_value = NULL;
  1242. size_t a = 12;
  1243. if (!_PyArg_CheckPositional("test_size_t_converter", nargs, 0, 1)) {
  1244. goto exit;
  1245. }
  1246. if (nargs < 1) {
  1247. goto skip_optional;
  1248. }
  1249. if (!_PyLong_Size_t_Converter(args[0], &a)) {
  1250. goto exit;
  1251. }
  1252. skip_optional:
  1253. return_value = test_size_t_converter_impl(module, a);
  1254. exit:
  1255. return return_value;
  1256. }
  1257. static PyObject *
  1258. test_size_t_converter_impl(PyObject *module, size_t a)
  1259. /*[clinic end generated code: output=1653ecb5cbf775aa input=52e93a0fed0f1fb3]*/
  1260. /*[clinic input]
  1261. test_float_converter
  1262. a: float = 12.5
  1263. /
  1264. [clinic start generated code]*/
  1265. PyDoc_STRVAR(test_float_converter__doc__,
  1266. "test_float_converter($module, a=12.5, /)\n"
  1267. "--\n"
  1268. "\n");
  1269. #define TEST_FLOAT_CONVERTER_METHODDEF \
  1270. {"test_float_converter", _PyCFunction_CAST(test_float_converter), METH_FASTCALL, test_float_converter__doc__},
  1271. static PyObject *
  1272. test_float_converter_impl(PyObject *module, float a);
  1273. static PyObject *
  1274. test_float_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  1275. {
  1276. PyObject *return_value = NULL;
  1277. float a = 12.5;
  1278. if (!_PyArg_CheckPositional("test_float_converter", nargs, 0, 1)) {
  1279. goto exit;
  1280. }
  1281. if (nargs < 1) {
  1282. goto skip_optional;
  1283. }
  1284. if (PyFloat_CheckExact(args[0])) {
  1285. a = (float) (PyFloat_AS_DOUBLE(args[0]));
  1286. }
  1287. else
  1288. {
  1289. a = (float) PyFloat_AsDouble(args[0]);
  1290. if (a == -1.0 && PyErr_Occurred()) {
  1291. goto exit;
  1292. }
  1293. }
  1294. skip_optional:
  1295. return_value = test_float_converter_impl(module, a);
  1296. exit:
  1297. return return_value;
  1298. }
  1299. static PyObject *
  1300. test_float_converter_impl(PyObject *module, float a)
  1301. /*[clinic end generated code: output=36ad006990a8a91e input=259c0d98eca35034]*/
  1302. /*[clinic input]
  1303. test_double_converter
  1304. a: double = 12.5
  1305. /
  1306. [clinic start generated code]*/
  1307. PyDoc_STRVAR(test_double_converter__doc__,
  1308. "test_double_converter($module, a=12.5, /)\n"
  1309. "--\n"
  1310. "\n");
  1311. #define TEST_DOUBLE_CONVERTER_METHODDEF \
  1312. {"test_double_converter", _PyCFunction_CAST(test_double_converter), METH_FASTCALL, test_double_converter__doc__},
  1313. static PyObject *
  1314. test_double_converter_impl(PyObject *module, double a);
  1315. static PyObject *
  1316. test_double_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  1317. {
  1318. PyObject *return_value = NULL;
  1319. double a = 12.5;
  1320. if (!_PyArg_CheckPositional("test_double_converter", nargs, 0, 1)) {
  1321. goto exit;
  1322. }
  1323. if (nargs < 1) {
  1324. goto skip_optional;
  1325. }
  1326. if (PyFloat_CheckExact(args[0])) {
  1327. a = PyFloat_AS_DOUBLE(args[0]);
  1328. }
  1329. else
  1330. {
  1331. a = PyFloat_AsDouble(args[0]);
  1332. if (a == -1.0 && PyErr_Occurred()) {
  1333. goto exit;
  1334. }
  1335. }
  1336. skip_optional:
  1337. return_value = test_double_converter_impl(module, a);
  1338. exit:
  1339. return return_value;
  1340. }
  1341. static PyObject *
  1342. test_double_converter_impl(PyObject *module, double a)
  1343. /*[clinic end generated code: output=7435925592bac795 input=c6a9945706a41c27]*/
  1344. /*[clinic input]
  1345. test_Py_complex_converter
  1346. a: Py_complex
  1347. /
  1348. [clinic start generated code]*/
  1349. PyDoc_STRVAR(test_Py_complex_converter__doc__,
  1350. "test_Py_complex_converter($module, a, /)\n"
  1351. "--\n"
  1352. "\n");
  1353. #define TEST_PY_COMPLEX_CONVERTER_METHODDEF \
  1354. {"test_Py_complex_converter", (PyCFunction)test_Py_complex_converter, METH_O, test_Py_complex_converter__doc__},
  1355. static PyObject *
  1356. test_Py_complex_converter_impl(PyObject *module, Py_complex a);
  1357. static PyObject *
  1358. test_Py_complex_converter(PyObject *module, PyObject *arg)
  1359. {
  1360. PyObject *return_value = NULL;
  1361. Py_complex a;
  1362. a = PyComplex_AsCComplex(arg);
  1363. if (PyErr_Occurred()) {
  1364. goto exit;
  1365. }
  1366. return_value = test_Py_complex_converter_impl(module, a);
  1367. exit:
  1368. return return_value;
  1369. }
  1370. static PyObject *
  1371. test_Py_complex_converter_impl(PyObject *module, Py_complex a)
  1372. /*[clinic end generated code: output=c2ecbec2144ca540 input=070f216a515beb79]*/
  1373. /*[clinic input]
  1374. test_str_converter
  1375. a: str = NULL
  1376. b: str = "ab"
  1377. c: str(accept={str}) = "cd"
  1378. d: str(accept={robuffer}) = "cef"
  1379. e: str(accept={str, NoneType}) = "gh"
  1380. f: str(accept={robuffer}, zeroes=True) = "ij"
  1381. g: str(accept={robuffer, str}, zeroes=True) = "kl"
  1382. h: str(accept={robuffer, str, NoneType}, zeroes=True) = "mn"
  1383. /
  1384. [clinic start generated code]*/
  1385. PyDoc_STRVAR(test_str_converter__doc__,
  1386. "test_str_converter($module, a=<unrepresentable>, b=\'ab\', c=\'cd\',\n"
  1387. " d=\'cef\', e=\'gh\', f=\'ij\', g=\'kl\', h=\'mn\', /)\n"
  1388. "--\n"
  1389. "\n");
  1390. #define TEST_STR_CONVERTER_METHODDEF \
  1391. {"test_str_converter", _PyCFunction_CAST(test_str_converter), METH_FASTCALL, test_str_converter__doc__},
  1392. static PyObject *
  1393. test_str_converter_impl(PyObject *module, const char *a, const char *b,
  1394. const char *c, const char *d, const char *e,
  1395. const char *f, Py_ssize_t f_length, const char *g,
  1396. Py_ssize_t g_length, const char *h,
  1397. Py_ssize_t h_length);
  1398. static PyObject *
  1399. test_str_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  1400. {
  1401. PyObject *return_value = NULL;
  1402. const char *a = NULL;
  1403. const char *b = "ab";
  1404. const char *c = "cd";
  1405. const char *d = "cef";
  1406. const char *e = "gh";
  1407. const char *f = "ij";
  1408. Py_ssize_t f_length;
  1409. const char *g = "kl";
  1410. Py_ssize_t g_length;
  1411. const char *h = "mn";
  1412. Py_ssize_t h_length;
  1413. if (!_PyArg_ParseStack(args, nargs, "|sssyzy#s#z#:test_str_converter",
  1414. &a, &b, &c, &d, &e, &f, &f_length, &g, &g_length, &h, &h_length)) {
  1415. goto exit;
  1416. }
  1417. return_value = test_str_converter_impl(module, a, b, c, d, e, f, f_length, g, g_length, h, h_length);
  1418. exit:
  1419. return return_value;
  1420. }
  1421. static PyObject *
  1422. test_str_converter_impl(PyObject *module, const char *a, const char *b,
  1423. const char *c, const char *d, const char *e,
  1424. const char *f, Py_ssize_t f_length, const char *g,
  1425. Py_ssize_t g_length, const char *h,
  1426. Py_ssize_t h_length)
  1427. /*[clinic end generated code: output=82cb06d5237ef062 input=8afe9da8185cd38c]*/
  1428. /*[clinic input]
  1429. test_str_converter_encoding
  1430. a: str(encoding="idna")
  1431. b: str(encoding="idna", accept={str})
  1432. c: str(encoding="idna", accept={bytes, bytearray, str})
  1433. d: str(encoding="idna", zeroes=True)
  1434. e: str(encoding="idna", accept={bytes, bytearray, str}, zeroes=True)
  1435. /
  1436. [clinic start generated code]*/
  1437. PyDoc_STRVAR(test_str_converter_encoding__doc__,
  1438. "test_str_converter_encoding($module, a, b, c, d, e, /)\n"
  1439. "--\n"
  1440. "\n");
  1441. #define TEST_STR_CONVERTER_ENCODING_METHODDEF \
  1442. {"test_str_converter_encoding", _PyCFunction_CAST(test_str_converter_encoding), METH_FASTCALL, test_str_converter_encoding__doc__},
  1443. static PyObject *
  1444. test_str_converter_encoding_impl(PyObject *module, char *a, char *b, char *c,
  1445. char *d, Py_ssize_t d_length, char *e,
  1446. Py_ssize_t e_length);
  1447. static PyObject *
  1448. test_str_converter_encoding(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  1449. {
  1450. PyObject *return_value = NULL;
  1451. char *a = NULL;
  1452. char *b = NULL;
  1453. char *c = NULL;
  1454. char *d = NULL;
  1455. Py_ssize_t d_length;
  1456. char *e = NULL;
  1457. Py_ssize_t e_length;
  1458. if (!_PyArg_ParseStack(args, nargs, "esesetes#et#:test_str_converter_encoding",
  1459. "idna", &a, "idna", &b, "idna", &c, "idna", &d, &d_length, "idna", &e, &e_length)) {
  1460. goto exit;
  1461. }
  1462. return_value = test_str_converter_encoding_impl(module, a, b, c, d, d_length, e, e_length);
  1463. /* Post parse cleanup for a */
  1464. PyMem_FREE(a);
  1465. /* Post parse cleanup for b */
  1466. PyMem_FREE(b);
  1467. /* Post parse cleanup for c */
  1468. PyMem_FREE(c);
  1469. /* Post parse cleanup for d */
  1470. PyMem_FREE(d);
  1471. /* Post parse cleanup for e */
  1472. PyMem_FREE(e);
  1473. exit:
  1474. return return_value;
  1475. }
  1476. static PyObject *
  1477. test_str_converter_encoding_impl(PyObject *module, char *a, char *b, char *c,
  1478. char *d, Py_ssize_t d_length, char *e,
  1479. Py_ssize_t e_length)
  1480. /*[clinic end generated code: output=999c1deecfa15b0a input=eb4c38e1f898f402]*/
  1481. /*[clinic input]
  1482. test_Py_UNICODE_converter
  1483. a: Py_UNICODE
  1484. b: Py_UNICODE(accept={str})
  1485. c: Py_UNICODE(accept={str, NoneType})
  1486. d: Py_UNICODE(zeroes=True)
  1487. e: Py_UNICODE(accept={str, NoneType}, zeroes=True)
  1488. /
  1489. [clinic start generated code]*/
  1490. PyDoc_STRVAR(test_Py_UNICODE_converter__doc__,
  1491. "test_Py_UNICODE_converter($module, a, b, c, d, e, /)\n"
  1492. "--\n"
  1493. "\n");
  1494. #define TEST_PY_UNICODE_CONVERTER_METHODDEF \
  1495. {"test_Py_UNICODE_converter", _PyCFunction_CAST(test_Py_UNICODE_converter), METH_FASTCALL, test_Py_UNICODE_converter__doc__},
  1496. static PyObject *
  1497. test_Py_UNICODE_converter_impl(PyObject *module, const Py_UNICODE *a,
  1498. const Py_UNICODE *b, const Py_UNICODE *c,
  1499. const Py_UNICODE *d, Py_ssize_t d_length,
  1500. const Py_UNICODE *e, Py_ssize_t e_length);
  1501. static PyObject *
  1502. test_Py_UNICODE_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  1503. {
  1504. PyObject *return_value = NULL;
  1505. const Py_UNICODE *a = NULL;
  1506. const Py_UNICODE *b = NULL;
  1507. const Py_UNICODE *c = NULL;
  1508. const Py_UNICODE *d = NULL;
  1509. Py_ssize_t d_length;
  1510. const Py_UNICODE *e = NULL;
  1511. Py_ssize_t e_length;
  1512. if (!_PyArg_ParseStack(args, nargs, "O&O&O&u#Z#:test_Py_UNICODE_converter",
  1513. _PyUnicode_WideCharString_Converter, &a, _PyUnicode_WideCharString_Converter, &b, _PyUnicode_WideCharString_Opt_Converter, &c, &d, &d_length, &e, &e_length)) {
  1514. goto exit;
  1515. }
  1516. return_value = test_Py_UNICODE_converter_impl(module, a, b, c, d, d_length, e, e_length);
  1517. exit:
  1518. /* Cleanup for a */
  1519. #if !USE_UNICODE_WCHAR_CACHE
  1520. PyMem_Free((void *)a);
  1521. #endif /* USE_UNICODE_WCHAR_CACHE */
  1522. /* Cleanup for b */
  1523. #if !USE_UNICODE_WCHAR_CACHE
  1524. PyMem_Free((void *)b);
  1525. #endif /* USE_UNICODE_WCHAR_CACHE */
  1526. /* Cleanup for c */
  1527. #if !USE_UNICODE_WCHAR_CACHE
  1528. PyMem_Free((void *)c);
  1529. #endif /* USE_UNICODE_WCHAR_CACHE */
  1530. return return_value;
  1531. }
  1532. static PyObject *
  1533. test_Py_UNICODE_converter_impl(PyObject *module, const Py_UNICODE *a,
  1534. const Py_UNICODE *b, const Py_UNICODE *c,
  1535. const Py_UNICODE *d, Py_ssize_t d_length,
  1536. const Py_UNICODE *e, Py_ssize_t e_length)
  1537. /*[clinic end generated code: output=9d41b3a38a0f6f2f input=064a3b68ad7f04b0]*/
  1538. /*[clinic input]
  1539. test_Py_buffer_converter
  1540. a: Py_buffer
  1541. b: Py_buffer(accept={buffer})
  1542. c: Py_buffer(accept={str, buffer})
  1543. d: Py_buffer(accept={str, buffer, NoneType})
  1544. e: Py_buffer(accept={rwbuffer})
  1545. /
  1546. [clinic start generated code]*/
  1547. PyDoc_STRVAR(test_Py_buffer_converter__doc__,
  1548. "test_Py_buffer_converter($module, a, b, c, d, e, /)\n"
  1549. "--\n"
  1550. "\n");
  1551. #define TEST_PY_BUFFER_CONVERTER_METHODDEF \
  1552. {"test_Py_buffer_converter", _PyCFunction_CAST(test_Py_buffer_converter), METH_FASTCALL, test_Py_buffer_converter__doc__},
  1553. static PyObject *
  1554. test_Py_buffer_converter_impl(PyObject *module, Py_buffer *a, Py_buffer *b,
  1555. Py_buffer *c, Py_buffer *d, Py_buffer *e);
  1556. static PyObject *
  1557. test_Py_buffer_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  1558. {
  1559. PyObject *return_value = NULL;
  1560. Py_buffer a = {NULL, NULL};
  1561. Py_buffer b = {NULL, NULL};
  1562. Py_buffer c = {NULL, NULL};
  1563. Py_buffer d = {NULL, NULL};
  1564. Py_buffer e = {NULL, NULL};
  1565. if (!_PyArg_ParseStack(args, nargs, "y*y*s*z*w*:test_Py_buffer_converter",
  1566. &a, &b, &c, &d, &e)) {
  1567. goto exit;
  1568. }
  1569. return_value = test_Py_buffer_converter_impl(module, &a, &b, &c, &d, &e);
  1570. exit:
  1571. /* Cleanup for a */
  1572. if (a.obj) {
  1573. PyBuffer_Release(&a);
  1574. }
  1575. /* Cleanup for b */
  1576. if (b.obj) {
  1577. PyBuffer_Release(&b);
  1578. }
  1579. /* Cleanup for c */
  1580. if (c.obj) {
  1581. PyBuffer_Release(&c);
  1582. }
  1583. /* Cleanup for d */
  1584. if (d.obj) {
  1585. PyBuffer_Release(&d);
  1586. }
  1587. /* Cleanup for e */
  1588. if (e.obj) {
  1589. PyBuffer_Release(&e);
  1590. }
  1591. return return_value;
  1592. }
  1593. static PyObject *
  1594. test_Py_buffer_converter_impl(PyObject *module, Py_buffer *a, Py_buffer *b,
  1595. Py_buffer *c, Py_buffer *d, Py_buffer *e)
  1596. /*[clinic end generated code: output=a153b71b4f45f952 input=6a9da0f56f9525fd]*/
  1597. /*[clinic input]
  1598. test_keywords
  1599. a: object
  1600. b: object
  1601. [clinic start generated code]*/
  1602. PyDoc_STRVAR(test_keywords__doc__,
  1603. "test_keywords($module, /, a, b)\n"
  1604. "--\n"
  1605. "\n");
  1606. #define TEST_KEYWORDS_METHODDEF \
  1607. {"test_keywords", _PyCFunction_CAST(test_keywords), METH_FASTCALL|METH_KEYWORDS, test_keywords__doc__},
  1608. static PyObject *
  1609. test_keywords_impl(PyObject *module, PyObject *a, PyObject *b);
  1610. static PyObject *
  1611. test_keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  1612. {
  1613. PyObject *return_value = NULL;
  1614. static const char * const _keywords[] = {"a", "b", NULL};
  1615. static _PyArg_Parser _parser = {NULL, _keywords, "test_keywords", 0};
  1616. PyObject *argsbuf[2];
  1617. PyObject *a;
  1618. PyObject *b;
  1619. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
  1620. if (!args) {
  1621. goto exit;
  1622. }
  1623. a = args[0];
  1624. b = args[1];
  1625. return_value = test_keywords_impl(module, a, b);
  1626. exit:
  1627. return return_value;
  1628. }
  1629. static PyObject *
  1630. test_keywords_impl(PyObject *module, PyObject *a, PyObject *b)
  1631. /*[clinic end generated code: output=c03a52cfca192d3b input=0d3484844749c05b]*/
  1632. /*[clinic input]
  1633. test_keywords_kwonly
  1634. a: object
  1635. *
  1636. b: object
  1637. [clinic start generated code]*/
  1638. PyDoc_STRVAR(test_keywords_kwonly__doc__,
  1639. "test_keywords_kwonly($module, /, a, *, b)\n"
  1640. "--\n"
  1641. "\n");
  1642. #define TEST_KEYWORDS_KWONLY_METHODDEF \
  1643. {"test_keywords_kwonly", _PyCFunction_CAST(test_keywords_kwonly), METH_FASTCALL|METH_KEYWORDS, test_keywords_kwonly__doc__},
  1644. static PyObject *
  1645. test_keywords_kwonly_impl(PyObject *module, PyObject *a, PyObject *b);
  1646. static PyObject *
  1647. test_keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  1648. {
  1649. PyObject *return_value = NULL;
  1650. static const char * const _keywords[] = {"a", "b", NULL};
  1651. static _PyArg_Parser _parser = {NULL, _keywords, "test_keywords_kwonly", 0};
  1652. PyObject *argsbuf[2];
  1653. PyObject *a;
  1654. PyObject *b;
  1655. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 1, argsbuf);
  1656. if (!args) {
  1657. goto exit;
  1658. }
  1659. a = args[0];
  1660. b = args[1];
  1661. return_value = test_keywords_kwonly_impl(module, a, b);
  1662. exit:
  1663. return return_value;
  1664. }
  1665. static PyObject *
  1666. test_keywords_kwonly_impl(PyObject *module, PyObject *a, PyObject *b)
  1667. /*[clinic end generated code: output=4704adcb6c7df928 input=384adc78bfa0bff7]*/
  1668. /*[clinic input]
  1669. test_keywords_opt
  1670. a: object
  1671. b: object = None
  1672. c: object = None
  1673. [clinic start generated code]*/
  1674. PyDoc_STRVAR(test_keywords_opt__doc__,
  1675. "test_keywords_opt($module, /, a, b=None, c=None)\n"
  1676. "--\n"
  1677. "\n");
  1678. #define TEST_KEYWORDS_OPT_METHODDEF \
  1679. {"test_keywords_opt", _PyCFunction_CAST(test_keywords_opt), METH_FASTCALL|METH_KEYWORDS, test_keywords_opt__doc__},
  1680. static PyObject *
  1681. test_keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b,
  1682. PyObject *c);
  1683. static PyObject *
  1684. test_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  1685. {
  1686. PyObject *return_value = NULL;
  1687. static const char * const _keywords[] = {"a", "b", "c", NULL};
  1688. static _PyArg_Parser _parser = {NULL, _keywords, "test_keywords_opt", 0};
  1689. PyObject *argsbuf[3];
  1690. Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
  1691. PyObject *a;
  1692. PyObject *b = Py_None;
  1693. PyObject *c = Py_None;
  1694. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
  1695. if (!args) {
  1696. goto exit;
  1697. }
  1698. a = args[0];
  1699. if (!noptargs) {
  1700. goto skip_optional_pos;
  1701. }
  1702. if (args[1]) {
  1703. b = args[1];
  1704. if (!--noptargs) {
  1705. goto skip_optional_pos;
  1706. }
  1707. }
  1708. c = args[2];
  1709. skip_optional_pos:
  1710. return_value = test_keywords_opt_impl(module, a, b, c);
  1711. exit:
  1712. return return_value;
  1713. }
  1714. static PyObject *
  1715. test_keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b,
  1716. PyObject *c)
  1717. /*[clinic end generated code: output=de3ee1039da35fa1 input=eda7964f784f4607]*/
  1718. /*[clinic input]
  1719. test_keywords_opt_kwonly
  1720. a: object
  1721. b: object = None
  1722. *
  1723. c: object = None
  1724. d: object = None
  1725. [clinic start generated code]*/
  1726. PyDoc_STRVAR(test_keywords_opt_kwonly__doc__,
  1727. "test_keywords_opt_kwonly($module, /, a, b=None, *, c=None, d=None)\n"
  1728. "--\n"
  1729. "\n");
  1730. #define TEST_KEYWORDS_OPT_KWONLY_METHODDEF \
  1731. {"test_keywords_opt_kwonly", _PyCFunction_CAST(test_keywords_opt_kwonly), METH_FASTCALL|METH_KEYWORDS, test_keywords_opt_kwonly__doc__},
  1732. static PyObject *
  1733. test_keywords_opt_kwonly_impl(PyObject *module, PyObject *a, PyObject *b,
  1734. PyObject *c, PyObject *d);
  1735. static PyObject *
  1736. test_keywords_opt_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  1737. {
  1738. PyObject *return_value = NULL;
  1739. static const char * const _keywords[] = {"a", "b", "c", "d", NULL};
  1740. static _PyArg_Parser _parser = {NULL, _keywords, "test_keywords_opt_kwonly", 0};
  1741. PyObject *argsbuf[4];
  1742. Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
  1743. PyObject *a;
  1744. PyObject *b = Py_None;
  1745. PyObject *c = Py_None;
  1746. PyObject *d = Py_None;
  1747. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
  1748. if (!args) {
  1749. goto exit;
  1750. }
  1751. a = args[0];
  1752. if (!noptargs) {
  1753. goto skip_optional_pos;
  1754. }
  1755. if (args[1]) {
  1756. b = args[1];
  1757. if (!--noptargs) {
  1758. goto skip_optional_pos;
  1759. }
  1760. }
  1761. skip_optional_pos:
  1762. if (!noptargs) {
  1763. goto skip_optional_kwonly;
  1764. }
  1765. if (args[2]) {
  1766. c = args[2];
  1767. if (!--noptargs) {
  1768. goto skip_optional_kwonly;
  1769. }
  1770. }
  1771. d = args[3];
  1772. skip_optional_kwonly:
  1773. return_value = test_keywords_opt_kwonly_impl(module, a, b, c, d);
  1774. exit:
  1775. return return_value;
  1776. }
  1777. static PyObject *
  1778. test_keywords_opt_kwonly_impl(PyObject *module, PyObject *a, PyObject *b,
  1779. PyObject *c, PyObject *d)
  1780. /*[clinic end generated code: output=996394678586854e input=209387a4815e5082]*/
  1781. /*[clinic input]
  1782. test_keywords_kwonly_opt
  1783. a: object
  1784. *
  1785. b: object = None
  1786. c: object = None
  1787. [clinic start generated code]*/
  1788. PyDoc_STRVAR(test_keywords_kwonly_opt__doc__,
  1789. "test_keywords_kwonly_opt($module, /, a, *, b=None, c=None)\n"
  1790. "--\n"
  1791. "\n");
  1792. #define TEST_KEYWORDS_KWONLY_OPT_METHODDEF \
  1793. {"test_keywords_kwonly_opt", _PyCFunction_CAST(test_keywords_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, test_keywords_kwonly_opt__doc__},
  1794. static PyObject *
  1795. test_keywords_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
  1796. PyObject *c);
  1797. static PyObject *
  1798. test_keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  1799. {
  1800. PyObject *return_value = NULL;
  1801. static const char * const _keywords[] = {"a", "b", "c", NULL};
  1802. static _PyArg_Parser _parser = {NULL, _keywords, "test_keywords_kwonly_opt", 0};
  1803. PyObject *argsbuf[3];
  1804. Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
  1805. PyObject *a;
  1806. PyObject *b = Py_None;
  1807. PyObject *c = Py_None;
  1808. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
  1809. if (!args) {
  1810. goto exit;
  1811. }
  1812. a = args[0];
  1813. if (!noptargs) {
  1814. goto skip_optional_kwonly;
  1815. }
  1816. if (args[1]) {
  1817. b = args[1];
  1818. if (!--noptargs) {
  1819. goto skip_optional_kwonly;
  1820. }
  1821. }
  1822. c = args[2];
  1823. skip_optional_kwonly:
  1824. return_value = test_keywords_kwonly_opt_impl(module, a, b, c);
  1825. exit:
  1826. return return_value;
  1827. }
  1828. static PyObject *
  1829. test_keywords_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
  1830. PyObject *c)
  1831. /*[clinic end generated code: output=4ea9947a903a2f24 input=18393cc64fa000f4]*/
  1832. /*[clinic input]
  1833. test_posonly_keywords
  1834. a: object
  1835. /
  1836. b: object
  1837. [clinic start generated code]*/
  1838. PyDoc_STRVAR(test_posonly_keywords__doc__,
  1839. "test_posonly_keywords($module, a, /, b)\n"
  1840. "--\n"
  1841. "\n");
  1842. #define TEST_POSONLY_KEYWORDS_METHODDEF \
  1843. {"test_posonly_keywords", _PyCFunction_CAST(test_posonly_keywords), METH_FASTCALL|METH_KEYWORDS, test_posonly_keywords__doc__},
  1844. static PyObject *
  1845. test_posonly_keywords_impl(PyObject *module, PyObject *a, PyObject *b);
  1846. static PyObject *
  1847. test_posonly_keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  1848. {
  1849. PyObject *return_value = NULL;
  1850. static const char * const _keywords[] = {"", "b", NULL};
  1851. static _PyArg_Parser _parser = {NULL, _keywords, "test_posonly_keywords", 0};
  1852. PyObject *argsbuf[2];
  1853. PyObject *a;
  1854. PyObject *b;
  1855. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
  1856. if (!args) {
  1857. goto exit;
  1858. }
  1859. a = args[0];
  1860. b = args[1];
  1861. return_value = test_posonly_keywords_impl(module, a, b);
  1862. exit:
  1863. return return_value;
  1864. }
  1865. static PyObject *
  1866. test_posonly_keywords_impl(PyObject *module, PyObject *a, PyObject *b)
  1867. /*[clinic end generated code: output=478aad346a188a80 input=1767b0ebdf06060e]*/
  1868. /*[clinic input]
  1869. test_posonly_kwonly
  1870. a: object
  1871. /
  1872. *
  1873. c: object
  1874. [clinic start generated code]*/
  1875. PyDoc_STRVAR(test_posonly_kwonly__doc__,
  1876. "test_posonly_kwonly($module, a, /, *, c)\n"
  1877. "--\n"
  1878. "\n");
  1879. #define TEST_POSONLY_KWONLY_METHODDEF \
  1880. {"test_posonly_kwonly", _PyCFunction_CAST(test_posonly_kwonly), METH_FASTCALL|METH_KEYWORDS, test_posonly_kwonly__doc__},
  1881. static PyObject *
  1882. test_posonly_kwonly_impl(PyObject *module, PyObject *a, PyObject *c);
  1883. static PyObject *
  1884. test_posonly_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  1885. {
  1886. PyObject *return_value = NULL;
  1887. static const char * const _keywords[] = {"", "c", NULL};
  1888. static _PyArg_Parser _parser = {NULL, _keywords, "test_posonly_kwonly", 0};
  1889. PyObject *argsbuf[2];
  1890. PyObject *a;
  1891. PyObject *c;
  1892. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 1, argsbuf);
  1893. if (!args) {
  1894. goto exit;
  1895. }
  1896. a = args[0];
  1897. c = args[1];
  1898. return_value = test_posonly_kwonly_impl(module, a, c);
  1899. exit:
  1900. return return_value;
  1901. }
  1902. static PyObject *
  1903. test_posonly_kwonly_impl(PyObject *module, PyObject *a, PyObject *c)
  1904. /*[clinic end generated code: output=d747975a0b28e9c2 input=9042f2818f664839]*/
  1905. /*[clinic input]
  1906. test_posonly_keywords_kwonly
  1907. a: object
  1908. /
  1909. b: object
  1910. *
  1911. c: object
  1912. [clinic start generated code]*/
  1913. PyDoc_STRVAR(test_posonly_keywords_kwonly__doc__,
  1914. "test_posonly_keywords_kwonly($module, a, /, b, *, c)\n"
  1915. "--\n"
  1916. "\n");
  1917. #define TEST_POSONLY_KEYWORDS_KWONLY_METHODDEF \
  1918. {"test_posonly_keywords_kwonly", _PyCFunction_CAST(test_posonly_keywords_kwonly), METH_FASTCALL|METH_KEYWORDS, test_posonly_keywords_kwonly__doc__},
  1919. static PyObject *
  1920. test_posonly_keywords_kwonly_impl(PyObject *module, PyObject *a, PyObject *b,
  1921. PyObject *c);
  1922. static PyObject *
  1923. test_posonly_keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  1924. {
  1925. PyObject *return_value = NULL;
  1926. static const char * const _keywords[] = {"", "b", "c", NULL};
  1927. static _PyArg_Parser _parser = {NULL, _keywords, "test_posonly_keywords_kwonly", 0};
  1928. PyObject *argsbuf[3];
  1929. PyObject *a;
  1930. PyObject *b;
  1931. PyObject *c;
  1932. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 1, argsbuf);
  1933. if (!args) {
  1934. goto exit;
  1935. }
  1936. a = args[0];
  1937. b = args[1];
  1938. c = args[2];
  1939. return_value = test_posonly_keywords_kwonly_impl(module, a, b, c);
  1940. exit:
  1941. return return_value;
  1942. }
  1943. static PyObject *
  1944. test_posonly_keywords_kwonly_impl(PyObject *module, PyObject *a, PyObject *b,
  1945. PyObject *c)
  1946. /*[clinic end generated code: output=5b99f692f8ddaa4a input=29546ebdca492fea]*/
  1947. /*[clinic input]
  1948. test_posonly_keywords_opt
  1949. a: object
  1950. /
  1951. b: object
  1952. c: object = None
  1953. d: object = None
  1954. [clinic start generated code]*/
  1955. PyDoc_STRVAR(test_posonly_keywords_opt__doc__,
  1956. "test_posonly_keywords_opt($module, a, /, b, c=None, d=None)\n"
  1957. "--\n"
  1958. "\n");
  1959. #define TEST_POSONLY_KEYWORDS_OPT_METHODDEF \
  1960. {"test_posonly_keywords_opt", _PyCFunction_CAST(test_posonly_keywords_opt), METH_FASTCALL|METH_KEYWORDS, test_posonly_keywords_opt__doc__},
  1961. static PyObject *
  1962. test_posonly_keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b,
  1963. PyObject *c, PyObject *d);
  1964. static PyObject *
  1965. test_posonly_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  1966. {
  1967. PyObject *return_value = NULL;
  1968. static const char * const _keywords[] = {"", "b", "c", "d", NULL};
  1969. static _PyArg_Parser _parser = {NULL, _keywords, "test_posonly_keywords_opt", 0};
  1970. PyObject *argsbuf[4];
  1971. Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
  1972. PyObject *a;
  1973. PyObject *b;
  1974. PyObject *c = Py_None;
  1975. PyObject *d = Py_None;
  1976. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 4, 0, argsbuf);
  1977. if (!args) {
  1978. goto exit;
  1979. }
  1980. a = args[0];
  1981. b = args[1];
  1982. if (!noptargs) {
  1983. goto skip_optional_pos;
  1984. }
  1985. if (args[2]) {
  1986. c = args[2];
  1987. if (!--noptargs) {
  1988. goto skip_optional_pos;
  1989. }
  1990. }
  1991. d = args[3];
  1992. skip_optional_pos:
  1993. return_value = test_posonly_keywords_opt_impl(module, a, b, c, d);
  1994. exit:
  1995. return return_value;
  1996. }
  1997. static PyObject *
  1998. test_posonly_keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b,
  1999. PyObject *c, PyObject *d)
  2000. /*[clinic end generated code: output=fd5dfbac5727aebb input=cdf5a9625e554e9b]*/
  2001. /*[clinic input]
  2002. test_posonly_keywords_opt2
  2003. a: object
  2004. /
  2005. b: object = None
  2006. c: object = None
  2007. [clinic start generated code]*/
  2008. PyDoc_STRVAR(test_posonly_keywords_opt2__doc__,
  2009. "test_posonly_keywords_opt2($module, a, /, b=None, c=None)\n"
  2010. "--\n"
  2011. "\n");
  2012. #define TEST_POSONLY_KEYWORDS_OPT2_METHODDEF \
  2013. {"test_posonly_keywords_opt2", _PyCFunction_CAST(test_posonly_keywords_opt2), METH_FASTCALL|METH_KEYWORDS, test_posonly_keywords_opt2__doc__},
  2014. static PyObject *
  2015. test_posonly_keywords_opt2_impl(PyObject *module, PyObject *a, PyObject *b,
  2016. PyObject *c);
  2017. static PyObject *
  2018. test_posonly_keywords_opt2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  2019. {
  2020. PyObject *return_value = NULL;
  2021. static const char * const _keywords[] = {"", "b", "c", NULL};
  2022. static _PyArg_Parser _parser = {NULL, _keywords, "test_posonly_keywords_opt2", 0};
  2023. PyObject *argsbuf[3];
  2024. Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
  2025. PyObject *a;
  2026. PyObject *b = Py_None;
  2027. PyObject *c = Py_None;
  2028. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
  2029. if (!args) {
  2030. goto exit;
  2031. }
  2032. a = args[0];
  2033. if (!noptargs) {
  2034. goto skip_optional_pos;
  2035. }
  2036. if (args[1]) {
  2037. b = args[1];
  2038. if (!--noptargs) {
  2039. goto skip_optional_pos;
  2040. }
  2041. }
  2042. c = args[2];
  2043. skip_optional_pos:
  2044. return_value = test_posonly_keywords_opt2_impl(module, a, b, c);
  2045. exit:
  2046. return return_value;
  2047. }
  2048. static PyObject *
  2049. test_posonly_keywords_opt2_impl(PyObject *module, PyObject *a, PyObject *b,
  2050. PyObject *c)
  2051. /*[clinic end generated code: output=777f58ac70775420 input=1581299d21d16f14]*/
  2052. /*[clinic input]
  2053. test_posonly_opt_keywords_opt
  2054. a: object
  2055. b: object = None
  2056. /
  2057. c: object = None
  2058. d: object = None
  2059. [clinic start generated code]*/
  2060. PyDoc_STRVAR(test_posonly_opt_keywords_opt__doc__,
  2061. "test_posonly_opt_keywords_opt($module, a, b=None, /, c=None, d=None)\n"
  2062. "--\n"
  2063. "\n");
  2064. #define TEST_POSONLY_OPT_KEYWORDS_OPT_METHODDEF \
  2065. {"test_posonly_opt_keywords_opt", _PyCFunction_CAST(test_posonly_opt_keywords_opt), METH_FASTCALL|METH_KEYWORDS, test_posonly_opt_keywords_opt__doc__},
  2066. static PyObject *
  2067. test_posonly_opt_keywords_opt_impl(PyObject *module, PyObject *a,
  2068. PyObject *b, PyObject *c, PyObject *d);
  2069. static PyObject *
  2070. test_posonly_opt_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  2071. {
  2072. PyObject *return_value = NULL;
  2073. static const char * const _keywords[] = {"", "", "c", "d", NULL};
  2074. static _PyArg_Parser _parser = {NULL, _keywords, "test_posonly_opt_keywords_opt", 0};
  2075. PyObject *argsbuf[4];
  2076. Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
  2077. PyObject *a;
  2078. PyObject *b = Py_None;
  2079. PyObject *c = Py_None;
  2080. PyObject *d = Py_None;
  2081. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 4, 0, argsbuf);
  2082. if (!args) {
  2083. goto exit;
  2084. }
  2085. a = args[0];
  2086. if (nargs < 2) {
  2087. goto skip_optional_posonly;
  2088. }
  2089. noptargs--;
  2090. b = args[1];
  2091. skip_optional_posonly:
  2092. if (!noptargs) {
  2093. goto skip_optional_pos;
  2094. }
  2095. if (args[2]) {
  2096. c = args[2];
  2097. if (!--noptargs) {
  2098. goto skip_optional_pos;
  2099. }
  2100. }
  2101. d = args[3];
  2102. skip_optional_pos:
  2103. return_value = test_posonly_opt_keywords_opt_impl(module, a, b, c, d);
  2104. exit:
  2105. return return_value;
  2106. }
  2107. static PyObject *
  2108. test_posonly_opt_keywords_opt_impl(PyObject *module, PyObject *a,
  2109. PyObject *b, PyObject *c, PyObject *d)
  2110. /*[clinic end generated code: output=2c18b8edff78ed22 input=408798ec3d42949f]*/
  2111. /*[clinic input]
  2112. test_posonly_kwonly_opt
  2113. a: object
  2114. /
  2115. *
  2116. b: object
  2117. c: object = None
  2118. d: object = None
  2119. [clinic start generated code]*/
  2120. PyDoc_STRVAR(test_posonly_kwonly_opt__doc__,
  2121. "test_posonly_kwonly_opt($module, a, /, *, b, c=None, d=None)\n"
  2122. "--\n"
  2123. "\n");
  2124. #define TEST_POSONLY_KWONLY_OPT_METHODDEF \
  2125. {"test_posonly_kwonly_opt", _PyCFunction_CAST(test_posonly_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, test_posonly_kwonly_opt__doc__},
  2126. static PyObject *
  2127. test_posonly_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
  2128. PyObject *c, PyObject *d);
  2129. static PyObject *
  2130. test_posonly_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  2131. {
  2132. PyObject *return_value = NULL;
  2133. static const char * const _keywords[] = {"", "b", "c", "d", NULL};
  2134. static _PyArg_Parser _parser = {NULL, _keywords, "test_posonly_kwonly_opt", 0};
  2135. PyObject *argsbuf[4];
  2136. Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
  2137. PyObject *a;
  2138. PyObject *b;
  2139. PyObject *c = Py_None;
  2140. PyObject *d = Py_None;
  2141. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 1, argsbuf);
  2142. if (!args) {
  2143. goto exit;
  2144. }
  2145. a = args[0];
  2146. b = args[1];
  2147. if (!noptargs) {
  2148. goto skip_optional_kwonly;
  2149. }
  2150. if (args[2]) {
  2151. c = args[2];
  2152. if (!--noptargs) {
  2153. goto skip_optional_kwonly;
  2154. }
  2155. }
  2156. d = args[3];
  2157. skip_optional_kwonly:
  2158. return_value = test_posonly_kwonly_opt_impl(module, a, b, c, d);
  2159. exit:
  2160. return return_value;
  2161. }
  2162. static PyObject *
  2163. test_posonly_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
  2164. PyObject *c, PyObject *d)
  2165. /*[clinic end generated code: output=8db9ab5602e1efaf input=8d8e5643bbbc2309]*/
  2166. /*[clinic input]
  2167. test_posonly_kwonly_opt2
  2168. a: object
  2169. /
  2170. *
  2171. b: object = None
  2172. c: object = None
  2173. [clinic start generated code]*/
  2174. PyDoc_STRVAR(test_posonly_kwonly_opt2__doc__,
  2175. "test_posonly_kwonly_opt2($module, a, /, *, b=None, c=None)\n"
  2176. "--\n"
  2177. "\n");
  2178. #define TEST_POSONLY_KWONLY_OPT2_METHODDEF \
  2179. {"test_posonly_kwonly_opt2", _PyCFunction_CAST(test_posonly_kwonly_opt2), METH_FASTCALL|METH_KEYWORDS, test_posonly_kwonly_opt2__doc__},
  2180. static PyObject *
  2181. test_posonly_kwonly_opt2_impl(PyObject *module, PyObject *a, PyObject *b,
  2182. PyObject *c);
  2183. static PyObject *
  2184. test_posonly_kwonly_opt2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  2185. {
  2186. PyObject *return_value = NULL;
  2187. static const char * const _keywords[] = {"", "b", "c", NULL};
  2188. static _PyArg_Parser _parser = {NULL, _keywords, "test_posonly_kwonly_opt2", 0};
  2189. PyObject *argsbuf[3];
  2190. Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
  2191. PyObject *a;
  2192. PyObject *b = Py_None;
  2193. PyObject *c = Py_None;
  2194. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
  2195. if (!args) {
  2196. goto exit;
  2197. }
  2198. a = args[0];
  2199. if (!noptargs) {
  2200. goto skip_optional_kwonly;
  2201. }
  2202. if (args[1]) {
  2203. b = args[1];
  2204. if (!--noptargs) {
  2205. goto skip_optional_kwonly;
  2206. }
  2207. }
  2208. c = args[2];
  2209. skip_optional_kwonly:
  2210. return_value = test_posonly_kwonly_opt2_impl(module, a, b, c);
  2211. exit:
  2212. return return_value;
  2213. }
  2214. static PyObject *
  2215. test_posonly_kwonly_opt2_impl(PyObject *module, PyObject *a, PyObject *b,
  2216. PyObject *c)
  2217. /*[clinic end generated code: output=6cfe546265d85d2c input=f7e5eed94f75fff0]*/
  2218. /*[clinic input]
  2219. test_posonly_opt_kwonly_opt
  2220. a: object
  2221. b: object = None
  2222. /
  2223. *
  2224. c: object = None
  2225. d: object = None
  2226. [clinic start generated code]*/
  2227. PyDoc_STRVAR(test_posonly_opt_kwonly_opt__doc__,
  2228. "test_posonly_opt_kwonly_opt($module, a, b=None, /, *, c=None, d=None)\n"
  2229. "--\n"
  2230. "\n");
  2231. #define TEST_POSONLY_OPT_KWONLY_OPT_METHODDEF \
  2232. {"test_posonly_opt_kwonly_opt", _PyCFunction_CAST(test_posonly_opt_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, test_posonly_opt_kwonly_opt__doc__},
  2233. static PyObject *
  2234. test_posonly_opt_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
  2235. PyObject *c, PyObject *d);
  2236. static PyObject *
  2237. test_posonly_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  2238. {
  2239. PyObject *return_value = NULL;
  2240. static const char * const _keywords[] = {"", "", "c", "d", NULL};
  2241. static _PyArg_Parser _parser = {NULL, _keywords, "test_posonly_opt_kwonly_opt", 0};
  2242. PyObject *argsbuf[4];
  2243. Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
  2244. PyObject *a;
  2245. PyObject *b = Py_None;
  2246. PyObject *c = Py_None;
  2247. PyObject *d = Py_None;
  2248. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
  2249. if (!args) {
  2250. goto exit;
  2251. }
  2252. a = args[0];
  2253. if (nargs < 2) {
  2254. goto skip_optional_posonly;
  2255. }
  2256. noptargs--;
  2257. b = args[1];
  2258. skip_optional_posonly:
  2259. if (!noptargs) {
  2260. goto skip_optional_kwonly;
  2261. }
  2262. if (args[2]) {
  2263. c = args[2];
  2264. if (!--noptargs) {
  2265. goto skip_optional_kwonly;
  2266. }
  2267. }
  2268. d = args[3];
  2269. skip_optional_kwonly:
  2270. return_value = test_posonly_opt_kwonly_opt_impl(module, a, b, c, d);
  2271. exit:
  2272. return return_value;
  2273. }
  2274. static PyObject *
  2275. test_posonly_opt_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
  2276. PyObject *c, PyObject *d)
  2277. /*[clinic end generated code: output=8b5e21a30cad22b7 input=1e557dc979d120fd]*/
  2278. /*[clinic input]
  2279. test_posonly_keywords_kwonly_opt
  2280. a: object
  2281. /
  2282. b: object
  2283. *
  2284. c: object
  2285. d: object = None
  2286. e: object = None
  2287. [clinic start generated code]*/
  2288. PyDoc_STRVAR(test_posonly_keywords_kwonly_opt__doc__,
  2289. "test_posonly_keywords_kwonly_opt($module, a, /, b, *, c, d=None, e=None)\n"
  2290. "--\n"
  2291. "\n");
  2292. #define TEST_POSONLY_KEYWORDS_KWONLY_OPT_METHODDEF \
  2293. {"test_posonly_keywords_kwonly_opt", _PyCFunction_CAST(test_posonly_keywords_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, test_posonly_keywords_kwonly_opt__doc__},
  2294. static PyObject *
  2295. test_posonly_keywords_kwonly_opt_impl(PyObject *module, PyObject *a,
  2296. PyObject *b, PyObject *c, PyObject *d,
  2297. PyObject *e);
  2298. static PyObject *
  2299. test_posonly_keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  2300. {
  2301. PyObject *return_value = NULL;
  2302. static const char * const _keywords[] = {"", "b", "c", "d", "e", NULL};
  2303. static _PyArg_Parser _parser = {NULL, _keywords, "test_posonly_keywords_kwonly_opt", 0};
  2304. PyObject *argsbuf[5];
  2305. Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3;
  2306. PyObject *a;
  2307. PyObject *b;
  2308. PyObject *c;
  2309. PyObject *d = Py_None;
  2310. PyObject *e = Py_None;
  2311. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 1, argsbuf);
  2312. if (!args) {
  2313. goto exit;
  2314. }
  2315. a = args[0];
  2316. b = args[1];
  2317. c = args[2];
  2318. if (!noptargs) {
  2319. goto skip_optional_kwonly;
  2320. }
  2321. if (args[3]) {
  2322. d = args[3];
  2323. if (!--noptargs) {
  2324. goto skip_optional_kwonly;
  2325. }
  2326. }
  2327. e = args[4];
  2328. skip_optional_kwonly:
  2329. return_value = test_posonly_keywords_kwonly_opt_impl(module, a, b, c, d, e);
  2330. exit:
  2331. return return_value;
  2332. }
  2333. static PyObject *
  2334. test_posonly_keywords_kwonly_opt_impl(PyObject *module, PyObject *a,
  2335. PyObject *b, PyObject *c, PyObject *d,
  2336. PyObject *e)
  2337. /*[clinic end generated code: output=950b9ace38b8b4a7 input=c3884a4f956fdc89]*/
  2338. /*[clinic input]
  2339. test_posonly_keywords_kwonly_opt2
  2340. a: object
  2341. /
  2342. b: object
  2343. *
  2344. c: object = None
  2345. d: object = None
  2346. [clinic start generated code]*/
  2347. PyDoc_STRVAR(test_posonly_keywords_kwonly_opt2__doc__,
  2348. "test_posonly_keywords_kwonly_opt2($module, a, /, b, *, c=None, d=None)\n"
  2349. "--\n"
  2350. "\n");
  2351. #define TEST_POSONLY_KEYWORDS_KWONLY_OPT2_METHODDEF \
  2352. {"test_posonly_keywords_kwonly_opt2", _PyCFunction_CAST(test_posonly_keywords_kwonly_opt2), METH_FASTCALL|METH_KEYWORDS, test_posonly_keywords_kwonly_opt2__doc__},
  2353. static PyObject *
  2354. test_posonly_keywords_kwonly_opt2_impl(PyObject *module, PyObject *a,
  2355. PyObject *b, PyObject *c, PyObject *d);
  2356. static PyObject *
  2357. test_posonly_keywords_kwonly_opt2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  2358. {
  2359. PyObject *return_value = NULL;
  2360. static const char * const _keywords[] = {"", "b", "c", "d", NULL};
  2361. static _PyArg_Parser _parser = {NULL, _keywords, "test_posonly_keywords_kwonly_opt2", 0};
  2362. PyObject *argsbuf[4];
  2363. Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
  2364. PyObject *a;
  2365. PyObject *b;
  2366. PyObject *c = Py_None;
  2367. PyObject *d = Py_None;
  2368. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
  2369. if (!args) {
  2370. goto exit;
  2371. }
  2372. a = args[0];
  2373. b = args[1];
  2374. if (!noptargs) {
  2375. goto skip_optional_kwonly;
  2376. }
  2377. if (args[2]) {
  2378. c = args[2];
  2379. if (!--noptargs) {
  2380. goto skip_optional_kwonly;
  2381. }
  2382. }
  2383. d = args[3];
  2384. skip_optional_kwonly:
  2385. return_value = test_posonly_keywords_kwonly_opt2_impl(module, a, b, c, d);
  2386. exit:
  2387. return return_value;
  2388. }
  2389. static PyObject *
  2390. test_posonly_keywords_kwonly_opt2_impl(PyObject *module, PyObject *a,
  2391. PyObject *b, PyObject *c, PyObject *d)
  2392. /*[clinic end generated code: output=fb6951a21b517317 input=68d01d7c0f6dafb0]*/
  2393. /*[clinic input]
  2394. test_posonly_keywords_opt_kwonly_opt
  2395. a: object
  2396. /
  2397. b: object
  2398. c: object = None
  2399. *
  2400. d: object = None
  2401. e: object = None
  2402. [clinic start generated code]*/
  2403. PyDoc_STRVAR(test_posonly_keywords_opt_kwonly_opt__doc__,
  2404. "test_posonly_keywords_opt_kwonly_opt($module, a, /, b, c=None, *,\n"
  2405. " d=None, e=None)\n"
  2406. "--\n"
  2407. "\n");
  2408. #define TEST_POSONLY_KEYWORDS_OPT_KWONLY_OPT_METHODDEF \
  2409. {"test_posonly_keywords_opt_kwonly_opt", _PyCFunction_CAST(test_posonly_keywords_opt_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, test_posonly_keywords_opt_kwonly_opt__doc__},
  2410. static PyObject *
  2411. test_posonly_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a,
  2412. PyObject *b, PyObject *c,
  2413. PyObject *d, PyObject *e);
  2414. static PyObject *
  2415. test_posonly_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  2416. {
  2417. PyObject *return_value = NULL;
  2418. static const char * const _keywords[] = {"", "b", "c", "d", "e", NULL};
  2419. static _PyArg_Parser _parser = {NULL, _keywords, "test_posonly_keywords_opt_kwonly_opt", 0};
  2420. PyObject *argsbuf[5];
  2421. Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
  2422. PyObject *a;
  2423. PyObject *b;
  2424. PyObject *c = Py_None;
  2425. PyObject *d = Py_None;
  2426. PyObject *e = Py_None;
  2427. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf);
  2428. if (!args) {
  2429. goto exit;
  2430. }
  2431. a = args[0];
  2432. b = args[1];
  2433. if (!noptargs) {
  2434. goto skip_optional_pos;
  2435. }
  2436. if (args[2]) {
  2437. c = args[2];
  2438. if (!--noptargs) {
  2439. goto skip_optional_pos;
  2440. }
  2441. }
  2442. skip_optional_pos:
  2443. if (!noptargs) {
  2444. goto skip_optional_kwonly;
  2445. }
  2446. if (args[3]) {
  2447. d = args[3];
  2448. if (!--noptargs) {
  2449. goto skip_optional_kwonly;
  2450. }
  2451. }
  2452. e = args[4];
  2453. skip_optional_kwonly:
  2454. return_value = test_posonly_keywords_opt_kwonly_opt_impl(module, a, b, c, d, e);
  2455. exit:
  2456. return return_value;
  2457. }
  2458. static PyObject *
  2459. test_posonly_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a,
  2460. PyObject *b, PyObject *c,
  2461. PyObject *d, PyObject *e)
  2462. /*[clinic end generated code: output=4db10815a99a857e input=d0883d45876f186c]*/
  2463. /*[clinic input]
  2464. test_posonly_keywords_opt2_kwonly_opt
  2465. a: object
  2466. /
  2467. b: object = None
  2468. c: object = None
  2469. *
  2470. d: object = None
  2471. e: object = None
  2472. [clinic start generated code]*/
  2473. PyDoc_STRVAR(test_posonly_keywords_opt2_kwonly_opt__doc__,
  2474. "test_posonly_keywords_opt2_kwonly_opt($module, a, /, b=None, c=None, *,\n"
  2475. " d=None, e=None)\n"
  2476. "--\n"
  2477. "\n");
  2478. #define TEST_POSONLY_KEYWORDS_OPT2_KWONLY_OPT_METHODDEF \
  2479. {"test_posonly_keywords_opt2_kwonly_opt", _PyCFunction_CAST(test_posonly_keywords_opt2_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, test_posonly_keywords_opt2_kwonly_opt__doc__},
  2480. static PyObject *
  2481. test_posonly_keywords_opt2_kwonly_opt_impl(PyObject *module, PyObject *a,
  2482. PyObject *b, PyObject *c,
  2483. PyObject *d, PyObject *e);
  2484. static PyObject *
  2485. test_posonly_keywords_opt2_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  2486. {
  2487. PyObject *return_value = NULL;
  2488. static const char * const _keywords[] = {"", "b", "c", "d", "e", NULL};
  2489. static _PyArg_Parser _parser = {NULL, _keywords, "test_posonly_keywords_opt2_kwonly_opt", 0};
  2490. PyObject *argsbuf[5];
  2491. Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
  2492. PyObject *a;
  2493. PyObject *b = Py_None;
  2494. PyObject *c = Py_None;
  2495. PyObject *d = Py_None;
  2496. PyObject *e = Py_None;
  2497. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
  2498. if (!args) {
  2499. goto exit;
  2500. }
  2501. a = args[0];
  2502. if (!noptargs) {
  2503. goto skip_optional_pos;
  2504. }
  2505. if (args[1]) {
  2506. b = args[1];
  2507. if (!--noptargs) {
  2508. goto skip_optional_pos;
  2509. }
  2510. }
  2511. if (args[2]) {
  2512. c = args[2];
  2513. if (!--noptargs) {
  2514. goto skip_optional_pos;
  2515. }
  2516. }
  2517. skip_optional_pos:
  2518. if (!noptargs) {
  2519. goto skip_optional_kwonly;
  2520. }
  2521. if (args[3]) {
  2522. d = args[3];
  2523. if (!--noptargs) {
  2524. goto skip_optional_kwonly;
  2525. }
  2526. }
  2527. e = args[4];
  2528. skip_optional_kwonly:
  2529. return_value = test_posonly_keywords_opt2_kwonly_opt_impl(module, a, b, c, d, e);
  2530. exit:
  2531. return return_value;
  2532. }
  2533. static PyObject *
  2534. test_posonly_keywords_opt2_kwonly_opt_impl(PyObject *module, PyObject *a,
  2535. PyObject *b, PyObject *c,
  2536. PyObject *d, PyObject *e)
  2537. /*[clinic end generated code: output=0416689b23ebf66e input=c95e2e1ec93035ad]*/
  2538. /*[clinic input]
  2539. test_posonly_opt_keywords_opt_kwonly_opt
  2540. a: object
  2541. b: object = None
  2542. /
  2543. c: object = None
  2544. d: object = None
  2545. *
  2546. e: object = None
  2547. f: object = None
  2548. [clinic start generated code]*/
  2549. PyDoc_STRVAR(test_posonly_opt_keywords_opt_kwonly_opt__doc__,
  2550. "test_posonly_opt_keywords_opt_kwonly_opt($module, a, b=None, /, c=None,\n"
  2551. " d=None, *, e=None, f=None)\n"
  2552. "--\n"
  2553. "\n");
  2554. #define TEST_POSONLY_OPT_KEYWORDS_OPT_KWONLY_OPT_METHODDEF \
  2555. {"test_posonly_opt_keywords_opt_kwonly_opt", _PyCFunction_CAST(test_posonly_opt_keywords_opt_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, test_posonly_opt_keywords_opt_kwonly_opt__doc__},
  2556. static PyObject *
  2557. test_posonly_opt_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a,
  2558. PyObject *b, PyObject *c,
  2559. PyObject *d, PyObject *e,
  2560. PyObject *f);
  2561. static PyObject *
  2562. test_posonly_opt_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  2563. {
  2564. PyObject *return_value = NULL;
  2565. static const char * const _keywords[] = {"", "", "c", "d", "e", "f", NULL};
  2566. static _PyArg_Parser _parser = {NULL, _keywords, "test_posonly_opt_keywords_opt_kwonly_opt", 0};
  2567. PyObject *argsbuf[6];
  2568. Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
  2569. PyObject *a;
  2570. PyObject *b = Py_None;
  2571. PyObject *c = Py_None;
  2572. PyObject *d = Py_None;
  2573. PyObject *e = Py_None;
  2574. PyObject *f = Py_None;
  2575. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 4, 0, argsbuf);
  2576. if (!args) {
  2577. goto exit;
  2578. }
  2579. a = args[0];
  2580. if (nargs < 2) {
  2581. goto skip_optional_posonly;
  2582. }
  2583. noptargs--;
  2584. b = args[1];
  2585. skip_optional_posonly:
  2586. if (!noptargs) {
  2587. goto skip_optional_pos;
  2588. }
  2589. if (args[2]) {
  2590. c = args[2];
  2591. if (!--noptargs) {
  2592. goto skip_optional_pos;
  2593. }
  2594. }
  2595. if (args[3]) {
  2596. d = args[3];
  2597. if (!--noptargs) {
  2598. goto skip_optional_pos;
  2599. }
  2600. }
  2601. skip_optional_pos:
  2602. if (!noptargs) {
  2603. goto skip_optional_kwonly;
  2604. }
  2605. if (args[4]) {
  2606. e = args[4];
  2607. if (!--noptargs) {
  2608. goto skip_optional_kwonly;
  2609. }
  2610. }
  2611. f = args[5];
  2612. skip_optional_kwonly:
  2613. return_value = test_posonly_opt_keywords_opt_kwonly_opt_impl(module, a, b, c, d, e, f);
  2614. exit:
  2615. return return_value;
  2616. }
  2617. static PyObject *
  2618. test_posonly_opt_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a,
  2619. PyObject *b, PyObject *c,
  2620. PyObject *d, PyObject *e,
  2621. PyObject *f)
  2622. /*[clinic end generated code: output=8892a137a8c8f46f input=9914857713c5bbf8]*/
  2623. /*[clinic input]
  2624. test_keyword_only_parameter
  2625. *
  2626. co_lnotab: PyBytesObject(c_default="(PyBytesObject *)self->co_lnotab") = None
  2627. [clinic start generated code]*/
  2628. PyDoc_STRVAR(test_keyword_only_parameter__doc__,
  2629. "test_keyword_only_parameter($module, /, *, co_lnotab=None)\n"
  2630. "--\n"
  2631. "\n");
  2632. #define TEST_KEYWORD_ONLY_PARAMETER_METHODDEF \
  2633. {"test_keyword_only_parameter", _PyCFunction_CAST(test_keyword_only_parameter), METH_FASTCALL|METH_KEYWORDS, test_keyword_only_parameter__doc__},
  2634. static PyObject *
  2635. test_keyword_only_parameter_impl(PyObject *module, PyBytesObject *co_lnotab);
  2636. static PyObject *
  2637. test_keyword_only_parameter(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  2638. {
  2639. PyObject *return_value = NULL;
  2640. static const char * const _keywords[] = {"co_lnotab", NULL};
  2641. static _PyArg_Parser _parser = {NULL, _keywords, "test_keyword_only_parameter", 0};
  2642. PyObject *argsbuf[1];
  2643. Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
  2644. PyBytesObject *co_lnotab = (PyBytesObject *)self->co_lnotab;
  2645. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, argsbuf);
  2646. if (!args) {
  2647. goto exit;
  2648. }
  2649. if (!noptargs) {
  2650. goto skip_optional_kwonly;
  2651. }
  2652. if (!PyBytes_Check(args[0])) {
  2653. _PyArg_BadArgument("test_keyword_only_parameter", "argument 'co_lnotab'", "bytes", args[0]);
  2654. goto exit;
  2655. }
  2656. co_lnotab = (PyBytesObject *)args[0];
  2657. skip_optional_kwonly:
  2658. return_value = test_keyword_only_parameter_impl(module, co_lnotab);
  2659. exit:
  2660. return return_value;
  2661. }
  2662. static PyObject *
  2663. test_keyword_only_parameter_impl(PyObject *module, PyBytesObject *co_lnotab)
  2664. /*[clinic end generated code: output=332b5f4b444c5d55 input=303df5046c7e37a3]*/
  2665. /*[clinic input]
  2666. output push
  2667. output preset buffer
  2668. [clinic start generated code]*/
  2669. /*[clinic end generated code: output=da39a3ee5e6b4b0d input=5bff3376ee0df0b5]*/
  2670. #ifdef CONDITION_A
  2671. /*[clinic input]
  2672. test_preprocessor_guarded_condition_a
  2673. [clinic start generated code]*/
  2674. static PyObject *
  2675. test_preprocessor_guarded_condition_a_impl(PyObject *module)
  2676. /*[clinic end generated code: output=ad012af18085add6 input=8edb8706a98cda7e]*/
  2677. #elif CONDITION_B
  2678. /*[clinic input]
  2679. test_preprocessor_guarded_elif_condition_b
  2680. [clinic start generated code]*/
  2681. static PyObject *
  2682. test_preprocessor_guarded_elif_condition_b_impl(PyObject *module)
  2683. /*[clinic end generated code: output=615f2dee82b138d1 input=53777cebbf7fee32]*/
  2684. #else
  2685. /*[clinic input]
  2686. test_preprocessor_guarded_else
  2687. [clinic start generated code]*/
  2688. static PyObject *
  2689. test_preprocessor_guarded_else_impl(PyObject *module)
  2690. /*[clinic end generated code: output=13af7670aac51b12 input=6657ab31d74c29fc]*/
  2691. #endif
  2692. /*[clinic input]
  2693. dump buffer
  2694. output pop
  2695. [clinic start generated code]*/
  2696. #if defined(CONDITION_A)
  2697. PyDoc_STRVAR(test_preprocessor_guarded_condition_a__doc__,
  2698. "test_preprocessor_guarded_condition_a($module, /)\n"
  2699. "--\n"
  2700. "\n");
  2701. #define TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF \
  2702. {"test_preprocessor_guarded_condition_a", (PyCFunction)test_preprocessor_guarded_condition_a, METH_NOARGS, test_preprocessor_guarded_condition_a__doc__},
  2703. static PyObject *
  2704. test_preprocessor_guarded_condition_a(PyObject *module, PyObject *Py_UNUSED(ignored))
  2705. {
  2706. return test_preprocessor_guarded_condition_a_impl(module);
  2707. }
  2708. #endif /* defined(CONDITION_A) */
  2709. #if !defined(CONDITION_A) && (CONDITION_B)
  2710. PyDoc_STRVAR(test_preprocessor_guarded_elif_condition_b__doc__,
  2711. "test_preprocessor_guarded_elif_condition_b($module, /)\n"
  2712. "--\n"
  2713. "\n");
  2714. #define TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF \
  2715. {"test_preprocessor_guarded_elif_condition_b", (PyCFunction)test_preprocessor_guarded_elif_condition_b, METH_NOARGS, test_preprocessor_guarded_elif_condition_b__doc__},
  2716. static PyObject *
  2717. test_preprocessor_guarded_elif_condition_b(PyObject *module, PyObject *Py_UNUSED(ignored))
  2718. {
  2719. return test_preprocessor_guarded_elif_condition_b_impl(module);
  2720. }
  2721. #endif /* !defined(CONDITION_A) && (CONDITION_B) */
  2722. #if !defined(CONDITION_A) && !(CONDITION_B)
  2723. PyDoc_STRVAR(test_preprocessor_guarded_else__doc__,
  2724. "test_preprocessor_guarded_else($module, /)\n"
  2725. "--\n"
  2726. "\n");
  2727. #define TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF \
  2728. {"test_preprocessor_guarded_else", (PyCFunction)test_preprocessor_guarded_else, METH_NOARGS, test_preprocessor_guarded_else__doc__},
  2729. static PyObject *
  2730. test_preprocessor_guarded_else(PyObject *module, PyObject *Py_UNUSED(ignored))
  2731. {
  2732. return test_preprocessor_guarded_else_impl(module);
  2733. }
  2734. #endif /* !defined(CONDITION_A) && !(CONDITION_B) */
  2735. #ifndef TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF
  2736. #define TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF
  2737. #endif /* !defined(TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF) */
  2738. #ifndef TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF
  2739. #define TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF
  2740. #endif /* !defined(TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF) */
  2741. #ifndef TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF
  2742. #define TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF
  2743. #endif /* !defined(TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF) */
  2744. /*[clinic end generated code: output=3804bb18d454038c input=3fc80c9989d2f2e1]*/
  2745. /*[clinic input]
  2746. test_vararg_and_posonly
  2747. a: object
  2748. *args: object
  2749. /
  2750. [clinic start generated code]*/
  2751. PyDoc_STRVAR(test_vararg_and_posonly__doc__,
  2752. "test_vararg_and_posonly($module, a, /, *args)\n"
  2753. "--\n"
  2754. "\n");
  2755. #define TEST_VARARG_AND_POSONLY_METHODDEF \
  2756. {"test_vararg_and_posonly", _PyCFunction_CAST(test_vararg_and_posonly), METH_FASTCALL, test_vararg_and_posonly__doc__},
  2757. static PyObject *
  2758. test_vararg_and_posonly_impl(PyObject *module, PyObject *a, PyObject *args);
  2759. static PyObject *
  2760. test_vararg_and_posonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
  2761. {
  2762. PyObject *return_value = NULL;
  2763. PyObject *a;
  2764. PyObject *__clinic_args = NULL;
  2765. if (!_PyArg_CheckPositional("test_vararg_and_posonly", nargs, 1, PY_SSIZE_T_MAX)) {
  2766. goto exit;
  2767. }
  2768. a = args[0];
  2769. __clinic_args = PyTuple_New(nargs - 1);
  2770. if (!__clinic_args) {
  2771. goto exit;
  2772. }
  2773. for (Py_ssize_t i = 0; i < nargs - 1; ++i) {
  2774. PyTuple_SET_ITEM(__clinic_args, i, Py_NewRef(args[1 + i]));
  2775. }
  2776. return_value = test_vararg_and_posonly_impl(module, a, __clinic_args);
  2777. exit:
  2778. Py_XDECREF(__clinic_args);
  2779. return return_value;
  2780. }
  2781. static PyObject *
  2782. test_vararg_and_posonly_impl(PyObject *module, PyObject *a, PyObject *args)
  2783. /*[clinic end generated code: output=79b75dc07decc8d6 input=08dc2bf7afbf1613]*/
  2784. /*[clinic input]
  2785. test_vararg
  2786. a: object
  2787. *args: object
  2788. [clinic start generated code]*/
  2789. PyDoc_STRVAR(test_vararg__doc__,
  2790. "test_vararg($module, /, a, *args)\n"
  2791. "--\n"
  2792. "\n");
  2793. #define TEST_VARARG_METHODDEF \
  2794. {"test_vararg", _PyCFunction_CAST(test_vararg), METH_FASTCALL|METH_KEYWORDS, test_vararg__doc__},
  2795. static PyObject *
  2796. test_vararg_impl(PyObject *module, PyObject *a, PyObject *args);
  2797. static PyObject *
  2798. test_vararg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  2799. {
  2800. PyObject *return_value = NULL;
  2801. static const char * const _keywords[] = {"a", NULL};
  2802. static _PyArg_Parser _parser = {NULL, _keywords, "test_vararg", 0};
  2803. PyObject *argsbuf[2];
  2804. PyObject *a;
  2805. PyObject *__clinic_args = NULL;
  2806. args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, 1, argsbuf);
  2807. if (!args) {
  2808. goto exit;
  2809. }
  2810. a = args[0];
  2811. __clinic_args = args[1];
  2812. return_value = test_vararg_impl(module, a, __clinic_args);
  2813. exit:
  2814. Py_XDECREF(__clinic_args);
  2815. return return_value;
  2816. }
  2817. static PyObject *
  2818. test_vararg_impl(PyObject *module, PyObject *a, PyObject *args)
  2819. /*[clinic end generated code: output=ce9334333757f6ea input=81d33815ad1bae6e]*/
  2820. /*[clinic input]
  2821. test_vararg_with_default
  2822. a: object
  2823. *args: object
  2824. b: bool = False
  2825. [clinic start generated code]*/
  2826. PyDoc_STRVAR(test_vararg_with_default__doc__,
  2827. "test_vararg_with_default($module, /, a, *args, b=False)\n"
  2828. "--\n"
  2829. "\n");
  2830. #define TEST_VARARG_WITH_DEFAULT_METHODDEF \
  2831. {"test_vararg_with_default", _PyCFunction_CAST(test_vararg_with_default), METH_FASTCALL|METH_KEYWORDS, test_vararg_with_default__doc__},
  2832. static PyObject *
  2833. test_vararg_with_default_impl(PyObject *module, PyObject *a, PyObject *args,
  2834. int b);
  2835. static PyObject *
  2836. test_vararg_with_default(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  2837. {
  2838. PyObject *return_value = NULL;
  2839. static const char * const _keywords[] = {"a", "b", NULL};
  2840. static _PyArg_Parser _parser = {NULL, _keywords, "test_vararg_with_default", 0};
  2841. PyObject *argsbuf[3];
  2842. Py_ssize_t noptargs = Py_MIN(nargs, 1) + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
  2843. PyObject *a;
  2844. PyObject *__clinic_args = NULL;
  2845. int b = 0;
  2846. args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, 1, argsbuf);
  2847. if (!args) {
  2848. goto exit;
  2849. }
  2850. a = args[0];
  2851. __clinic_args = args[1];
  2852. if (!noptargs) {
  2853. goto skip_optional_kwonly;
  2854. }
  2855. b = PyObject_IsTrue(args[2]);
  2856. if (b < 0) {
  2857. goto exit;
  2858. }
  2859. skip_optional_kwonly:
  2860. return_value = test_vararg_with_default_impl(module, a, __clinic_args, b);
  2861. exit:
  2862. Py_XDECREF(__clinic_args);
  2863. return return_value;
  2864. }
  2865. static PyObject *
  2866. test_vararg_with_default_impl(PyObject *module, PyObject *a, PyObject *args,
  2867. int b)
  2868. /*[clinic end generated code: output=32fb19dd6bcf9185 input=6e110b54acd9b22d]*/
  2869. /*[clinic input]
  2870. test_vararg_with_only_defaults
  2871. *args: object
  2872. b: bool = False
  2873. c: object = ' '
  2874. [clinic start generated code]*/
  2875. PyDoc_STRVAR(test_vararg_with_only_defaults__doc__,
  2876. "test_vararg_with_only_defaults($module, /, *args, b=False, c=\' \')\n"
  2877. "--\n"
  2878. "\n");
  2879. #define TEST_VARARG_WITH_ONLY_DEFAULTS_METHODDEF \
  2880. {"test_vararg_with_only_defaults", _PyCFunction_CAST(test_vararg_with_only_defaults), METH_FASTCALL|METH_KEYWORDS, test_vararg_with_only_defaults__doc__},
  2881. static PyObject *
  2882. test_vararg_with_only_defaults_impl(PyObject *module, PyObject *args, int b,
  2883. PyObject *c);
  2884. static PyObject *
  2885. test_vararg_with_only_defaults(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  2886. {
  2887. PyObject *return_value = NULL;
  2888. static const char * const _keywords[] = {"b", "c", NULL};
  2889. static _PyArg_Parser _parser = {NULL, _keywords, "test_vararg_with_only_defaults", 0};
  2890. PyObject *argsbuf[3];
  2891. Py_ssize_t noptargs = 0 + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
  2892. PyObject *__clinic_args = NULL;
  2893. int b = 0;
  2894. PyObject *c = " ";
  2895. args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, 0, argsbuf);
  2896. if (!args) {
  2897. goto exit;
  2898. }
  2899. __clinic_args = args[0];
  2900. if (!noptargs) {
  2901. goto skip_optional_kwonly;
  2902. }
  2903. if (args[1]) {
  2904. b = PyObject_IsTrue(args[1]);
  2905. if (b < 0) {
  2906. goto exit;
  2907. }
  2908. if (!--noptargs) {
  2909. goto skip_optional_kwonly;
  2910. }
  2911. }
  2912. c = args[2];
  2913. skip_optional_kwonly:
  2914. return_value = test_vararg_with_only_defaults_impl(module, __clinic_args, b, c);
  2915. exit:
  2916. Py_XDECREF(__clinic_args);
  2917. return return_value;
  2918. }
  2919. static PyObject *
  2920. test_vararg_with_only_defaults_impl(PyObject *module, PyObject *args, int b,
  2921. PyObject *c)
  2922. /*[clinic end generated code: output=7e393689e6ce61a3 input=fa56a709a035666e]*/
  2923. /*[clinic input]
  2924. test_paramname_module
  2925. module as mod: object
  2926. [clinic start generated code]*/
  2927. PyDoc_STRVAR(test_paramname_module__doc__,
  2928. "test_paramname_module($module, /, module)\n"
  2929. "--\n"
  2930. "\n");
  2931. #define TEST_PARAMNAME_MODULE_METHODDEF \
  2932. {"test_paramname_module", _PyCFunction_CAST(test_paramname_module), METH_FASTCALL|METH_KEYWORDS, test_paramname_module__doc__},
  2933. static PyObject *
  2934. test_paramname_module_impl(PyObject *module, PyObject *mod);
  2935. static PyObject *
  2936. test_paramname_module(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
  2937. {
  2938. PyObject *return_value = NULL;
  2939. static const char * const _keywords[] = {"module", NULL};
  2940. static _PyArg_Parser _parser = {NULL, _keywords, "test_paramname_module", 0};
  2941. PyObject *argsbuf[1];
  2942. PyObject *mod;
  2943. args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
  2944. if (!args) {
  2945. goto exit;
  2946. }
  2947. mod = args[0];
  2948. return_value = test_paramname_module_impl(module, mod);
  2949. exit:
  2950. return return_value;
  2951. }
  2952. static PyObject *
  2953. test_paramname_module_impl(PyObject *module, PyObject *mod)
  2954. /*[clinic end generated code: output=23379a7ffa65c514 input=afefe259667f13ba]*/