Skip to content

Commit 1cdf313

Browse files
committed
Revert "Indicate positional-only parameters"
This reverts commit eb21bb1
1 parent 073e2ff commit 1cdf313

File tree

7 files changed

+234
-94
lines changed

7 files changed

+234
-94
lines changed

Include/internal/pycore_global_objects_fini_generated.h

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_global_strings.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ struct _Py_global_strings {
369369
STRUCT_FOR_ID(command)
370370
STRUCT_FOR_ID(comment_factory)
371371
STRUCT_FOR_ID(compile_mode)
372+
STRUCT_FOR_ID(config)
372373
STRUCT_FOR_ID(consts)
373374
STRUCT_FOR_ID(context)
374375
STRUCT_FOR_ID(contravariant)
@@ -427,6 +428,7 @@ struct _Py_global_strings {
427428
STRUCT_FOR_ID(errors)
428429
STRUCT_FOR_ID(event)
429430
STRUCT_FOR_ID(eventmask)
431+
STRUCT_FOR_ID(exc_arg)
430432
STRUCT_FOR_ID(exc_type)
431433
STRUCT_FOR_ID(exc_value)
432434
STRUCT_FOR_ID(excepthook)
@@ -796,6 +798,7 @@ struct _Py_global_strings {
796798
STRUCT_FOR_ID(uid)
797799
STRUCT_FOR_ID(unlink)
798800
STRUCT_FOR_ID(unraisablehook)
801+
STRUCT_FOR_ID(updates)
799802
STRUCT_FOR_ID(uri)
800803
STRUCT_FOR_ID(usedforsecurity)
801804
STRUCT_FOR_ID(value)

Include/internal/pycore_runtime_init_generated.h

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_unicodeobject_generated.h

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/test/test__interpreters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ def test_signatures(self):
486486
with self.assertRaisesRegex(TypeError, msg):
487487
_interpreters.run_func(self.id, lambda: None, shared=1)
488488
# See https://github.com/python/cpython/issues/135855
489-
msg = r'set___main___attrs\(\) argument 2 must be dict, not int'
489+
msg = r"set___main___attrs\(\) argument 'updates' must be dict, not int"
490490
with self.assertRaisesRegex(TypeError, msg):
491491
_interpreters.set___main___attrs(self.id, 1)
492492

Modules/_interpretersmodule.c

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,6 @@ overriding the initial values.");
851851
/*[clinic input]
852852
_interpreters.create
853853
config as configobj: object(py_default="'isolated'") = NULL
854-
/
855854
*
856855
reqrefs: bool = False
857856
@@ -869,7 +868,7 @@ is 'isolated'.
869868

870869
static PyObject *
871870
_interpreters_create_impl(PyObject *module, PyObject *configobj, int reqrefs)
872-
/*[clinic end generated code: output=c1cc6835b1277c16 input=74f4d259e9f6f3d0]*/
871+
/*[clinic end generated code: output=c1cc6835b1277c16 input=235ce396a23624d5]*/
873872
{
874873
PyInterpreterConfig config;
875874
if (config_from_object(configobj, &config) < 0) {
@@ -907,7 +906,6 @@ _interpreters_create_impl(PyObject *module, PyObject *configobj, int reqrefs)
907906
/*[clinic input]
908907
_interpreters.destroy
909908
id: object
910-
/
911909
*
912910
restrict as restricted: bool = False
913911
@@ -919,7 +917,7 @@ So does an unrecognized ID.
919917

920918
static PyObject *
921919
_interpreters_destroy_impl(PyObject *module, PyObject *id, int restricted)
922-
/*[clinic end generated code: output=0bc20da8700ab4dd input=d2cfa1ef3b4a4ea5]*/
920+
/*[clinic end generated code: output=0bc20da8700ab4dd input=561bdd6537639d40]*/
923921
{
924922
// Look up the interpreter.
925923
int reqready = 0;
@@ -1034,8 +1032,7 @@ _interpreters_get_main_impl(PyObject *module)
10341032
/*[clinic input]
10351033
_interpreters.set___main___attrs
10361034
id: object
1037-
ns as updates: object(subclass_of='&PyDict_Type')
1038-
/
1035+
updates: object(subclass_of='&PyDict_Type')
10391036
*
10401037
restrict as restricted: bool = False
10411038
@@ -1045,7 +1042,7 @@ Bind the given attributes in the interpreter's __main__ module.
10451042
static PyObject *
10461043
_interpreters_set___main___attrs_impl(PyObject *module, PyObject *id,
10471044
PyObject *updates, int restricted)
1048-
/*[clinic end generated code: output=f3803010cb452bf0 input=69d409c4dd04dab9]*/
1045+
/*[clinic end generated code: output=f3803010cb452bf0 input=d16ab8d81371f86a]*/
10491046
{
10501047
// Look up the interpreter.
10511048
int reqready = 1;
@@ -1109,7 +1106,6 @@ _handle_script_error(struct run_result *runres)
11091106
/*[clinic input]
11101107
_interpreters.exec
11111108
id: object
1112-
/
11131109
code: object
11141110
shared: object(subclass_of='&PyDict_Type', c_default='NULL') = {}
11151111
*
@@ -1134,7 +1130,7 @@ is ignored, including its __globals__ dict.
11341130
static PyObject *
11351131
_interpreters_exec_impl(PyObject *module, PyObject *id, PyObject *code,
11361132
PyObject *shared, int restricted)
1137-
/*[clinic end generated code: output=492057c4f10dc304 input=687f3f6ac5294593]*/
1133+
/*[clinic end generated code: output=492057c4f10dc304 input=5a22c1ed0c5dbcf3]*/
11381134
{
11391135
PyThreadState *tstate = _PyThreadState_GET();
11401136
int reqready = 1;
@@ -1166,7 +1162,6 @@ _interpreters_exec_impl(PyObject *module, PyObject *id, PyObject *code,
11661162
/*[clinic input]
11671163
_interpreters.run_string
11681164
id: object
1169-
/
11701165
script: unicode
11711166
shared: object(subclass_of='&PyDict_Type', c_default='NULL') = {}
11721167
*
@@ -1181,7 +1176,7 @@ static PyObject *
11811176
_interpreters_run_string_impl(PyObject *module, PyObject *id,
11821177
PyObject *script, PyObject *shared,
11831178
int restricted)
1184-
/*[clinic end generated code: output=a30a64fb9ad396a2 input=9158a58996e05957]*/
1179+
/*[clinic end generated code: output=a30a64fb9ad396a2 input=51ce549b9a8dbe21]*/
11851180
{
11861181
#define FUNCNAME MODULE_NAME_STR ".run_string"
11871182
PyThreadState *tstate = _PyThreadState_GET();
@@ -1218,7 +1213,6 @@ _interpreters_run_string_impl(PyObject *module, PyObject *id,
12181213
/*[clinic input]
12191214
_interpreters.run_func
12201215
id: object
1221-
/
12221216
func: object
12231217
shared: object(subclass_of='&PyDict_Type', c_default='NULL') = {}
12241218
*
@@ -1235,7 +1229,7 @@ are not supported. Methods and other callables are not supported either.
12351229
static PyObject *
12361230
_interpreters_run_func_impl(PyObject *module, PyObject *id, PyObject *func,
12371231
PyObject *shared, int restricted)
1238-
/*[clinic end generated code: output=131f7202ca4a0c5e input=aa2dbab6f7354cd6]*/
1232+
/*[clinic end generated code: output=131f7202ca4a0c5e input=2d62bb9b9eaf4948]*/
12391233
{
12401234
#define FUNCNAME MODULE_NAME_STR ".run_func"
12411235
PyThreadState *tstate = _PyThreadState_GET();
@@ -1281,7 +1275,6 @@ _interpreters_run_func_impl(PyObject *module, PyObject *id, PyObject *func,
12811275
/*[clinic input]
12821276
_interpreters.call
12831277
id: object
1284-
/
12851278
callable: object
12861279
args as args_obj: object(subclass_of='&PyTuple_Type', c_default='NULL') = ()
12871280
kwargs as kwargs_obj: object(subclass_of='&PyDict_Type', c_default='NULL') = {}
@@ -1298,7 +1291,7 @@ static PyObject *
12981291
_interpreters_call_impl(PyObject *module, PyObject *id, PyObject *callable,
12991292
PyObject *args_obj, PyObject *kwargs_obj,
13001293
int preserve_exc, int restricted)
1301-
/*[clinic end generated code: output=983ee27b3c43f6ef input=826c8dab4b1059b4]*/
1294+
/*[clinic end generated code: output=983ee27b3c43f6ef input=77590fdb3f519d65]*/
13021295
{
13031296
PyThreadState *tstate = _PyThreadState_GET();
13041297
int reqready = 1;
@@ -1337,14 +1330,13 @@ _interpreters_call_impl(PyObject *module, PyObject *id, PyObject *callable,
13371330
/*[clinic input]
13381331
_interpreters.is_shareable
13391332
obj: object
1340-
/
13411333
13421334
Return True if the object's data may be shared between interpreters and False otherwise.
13431335
[clinic start generated code]*/
13441336

13451337
static PyObject *
1346-
_interpreters_is_shareable(PyObject *module, PyObject *obj)
1347-
/*[clinic end generated code: output=f2169d4c1f5d7bca input=4239989a8634b292]*/
1338+
_interpreters_is_shareable_impl(PyObject *module, PyObject *obj)
1339+
/*[clinic end generated code: output=227856926a22940b input=72b9a36bdf1d2a53]*/
13481340
{
13491341
PyThreadState *tstate = _PyThreadState_GET();
13501342
if (_PyObject_CheckXIData(tstate, obj) == 0) {
@@ -1358,7 +1350,6 @@ _interpreters_is_shareable(PyObject *module, PyObject *obj)
13581350
/*[clinic input]
13591351
_interpreters.is_running
13601352
id: object
1361-
/
13621353
*
13631354
restrict as restricted: bool = False
13641355
@@ -1367,7 +1358,7 @@ Return whether or not the identified interpreter is running.
13671358

13681359
static PyObject *
13691360
_interpreters_is_running_impl(PyObject *module, PyObject *id, int restricted)
1370-
/*[clinic end generated code: output=32a6225d5ded9bdb input=a4d98a82fcb4bf6e]*/
1361+
/*[clinic end generated code: output=32a6225d5ded9bdb input=3291578d04231125]*/
13711362
{
13721363
int reqready = 1;
13731364
PyInterpreterState *interp = \
@@ -1386,7 +1377,6 @@ _interpreters_is_running_impl(PyObject *module, PyObject *id, int restricted)
13861377
/*[clinic input]
13871378
_interpreters.get_config
13881379
id as idobj: object
1389-
/
13901380
*
13911381
restrict as restricted: bool = False
13921382
@@ -1396,7 +1386,7 @@ Return a representation of the config used to initialize the interpreter.
13961386
static PyObject *
13971387
_interpreters_get_config_impl(PyObject *module, PyObject *idobj,
13981388
int restricted)
1399-
/*[clinic end generated code: output=63f81d35c2fe1387 input=79d88cf77a8ba034]*/
1389+
/*[clinic end generated code: output=63f81d35c2fe1387 input=aa38d50f534eb3c5]*/
14001390
{
14011391
if (idobj == Py_None) {
14021392
idobj = NULL;
@@ -1427,14 +1417,13 @@ _interpreters_get_config_impl(PyObject *module, PyObject *idobj,
14271417
/*[clinic input]
14281418
_interpreters.whence
14291419
id: object
1430-
/
14311420
14321421
Return an identifier for where the interpreter was created.
14331422
[clinic start generated code]*/
14341423

14351424
static PyObject *
1436-
_interpreters_whence(PyObject *module, PyObject *id)
1437-
/*[clinic end generated code: output=e558d207672470cf input=6148f02c882e39f6]*/
1425+
_interpreters_whence_impl(PyObject *module, PyObject *id)
1426+
/*[clinic end generated code: output=ef2c21ab106c2c20 input=eeede0a2fbfa2968]*/
14381427
{
14391428
PyInterpreterState *interp = look_up_interp(id);
14401429
if (interp == NULL) {
@@ -1449,7 +1438,6 @@ _interpreters_whence(PyObject *module, PyObject *id)
14491438
/*[clinic input]
14501439
_interpreters.incref
14511440
id: object
1452-
/
14531441
*
14541442
implieslink: bool = False
14551443
restrict as restricted: bool = False
@@ -1459,7 +1447,7 @@ _interpreters.incref
14591447
static PyObject *
14601448
_interpreters_incref_impl(PyObject *module, PyObject *id, int implieslink,
14611449
int restricted)
1462-
/*[clinic end generated code: output=eccaa4e03fbe8ee2 input=a49374f447dead6f]*/
1450+
/*[clinic end generated code: output=eccaa4e03fbe8ee2 input=a0a614748f2e348c]*/
14631451
{
14641452
int reqready = 1;
14651453
PyInterpreterState *interp = \
@@ -1481,15 +1469,14 @@ _interpreters_incref_impl(PyObject *module, PyObject *id, int implieslink,
14811469
/*[clinic input]
14821470
_interpreters.decref
14831471
id: object
1484-
/
14851472
*
14861473
restrict as restricted: bool = False
14871474
14881475
[clinic start generated code]*/
14891476

14901477
static PyObject *
14911478
_interpreters_decref_impl(PyObject *module, PyObject *id, int restricted)
1492-
/*[clinic end generated code: output=5c54db4b22086171 input=6f82beeae0b1c2b1]*/
1479+
/*[clinic end generated code: output=5c54db4b22086171 input=c4aa34f09c44e62a]*/
14931480
{
14941481
int reqready = 1;
14951482
PyInterpreterState *interp = \
@@ -1507,7 +1494,6 @@ _interpreters_decref_impl(PyObject *module, PyObject *id, int restricted)
15071494
/*[clinic input]
15081495
_interpreters.capture_exception
15091496
exc_arg: object(c_default='NULL') = None
1510-
/
15111497
15121498
Return a snapshot of an exception.
15131499
@@ -1517,7 +1503,7 @@ The returned snapshot is the same as what _interpreters.exec() returns.
15171503

15181504
static PyObject *
15191505
_interpreters_capture_exception_impl(PyObject *module, PyObject *exc_arg)
1520-
/*[clinic end generated code: output=ef3f5393ef9c88a6 input=e67d59d7fbb6d58c]*/
1506+
/*[clinic end generated code: output=ef3f5393ef9c88a6 input=e607efac7eb95fba]*/
15211507
{
15221508
PyObject *exc = exc_arg;
15231509
if (exc == NULL || exc == Py_None) {

0 commit comments

Comments
 (0)