8000 default_ -> default_value · python/cpython@7efa4ce · GitHub
[go: up one dir, main page]

Skip to content

Commit 7efa4ce

Browse files
committed
default_ -> default_value
1 parent 6f66775 commit 7efa4ce

File tree

1 file changed

+54
-54
lines changed

1 file changed

+54
-54
lines changed

Objects/typevarobject.c

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ typedef struct {
2323
PyObject *evaluate_bound;
2424
PyObject *constraints;
2525
PyObject *evaluate_constraints;
26-
PyObject *default_;
26+
PyObject *default_value;
2727
PyObject *evaluate_default;
2828
bool covariant;
2929
bool contravariant;
@@ -33,15 +33,15 @@ typedef struct {
3333
typedef struct {
3434
PyObject_HEAD
3535
PyObject *name;
36-
PyObject *default_;
36+
PyObject *default_value;
3737
PyObject *evaluate_default;
3838
} typevartupleobject;
3939

4040
typedef struct {
4141
PyObject_HEAD
4242
PyObject *name;
4343
PyObject *bound;
44-
PyObject *default_;
44+
PyObject *default_value;
4545
PyObject *evaluate_default;
4646
bool covariant;
4747
bool contravariant;
@@ -206,7 +206,7 @@ typevar_dealloc(PyObject *self)
206206
Py_XDECREF(tv->evaluate_bound);
207207
Py_XDECREF(tv->constraints);
208208
Py_XDECREF(tv->evaluate_constraints);
209-
Py_XDECREF(tv->default_);
209+
Py_XDECREF(tv->default_value);
210210
Py_XDECREF(tv->evaluate_default);
211211
PyObject_ClearManagedDict(self);
212212
PyObject_ClearWeakRefs(self);
@@ -224,7 +224,7 @@ typevar_traverse(PyObject *self, visitproc visit, void *arg)
224224
Py_VISIT(tv->evaluate_bound);
225225
Py_VISIT(tv->constraints);
226226
Py_VISIT(tv->evaluate_constraints);
227-
Py_VISIT(tv->default_);
227+
Py_VISIT(tv->default_value);
228228
Py_VISIT(tv->evaluate_default);
229229
PyObject_VisitManagedDict(self, visit, arg);
230230
return 0;
@@ -237,7 +237,7 @@ typevar_clear(typevarobject *self)
237237
Py_CLEAR(self->evaluate_bound);
238238
Py_CLEAR(self->constraints);
239239
Py_CLEAR(self->evaluate_constraints);
240-
Py_CLEAR(self->default_);
240+
Py_CLEAR(self->default_value);
241241
Py_CLEAR(self->evaluate_default);
242242
PyObject_ClearManagedDict((PyObject *)self);
243243
return 0;
@@ -281,18 +281,18 @@ typevar_bound(typevarobject *self, void *Py_UNUSED(ignored))
2 57AE 81281
static PyObject *
282282
typevar_default(typevarobject *self, void *unused)
283283
{
284-
if (self->default_ != NULL) {
285-
return Py_NewRef(self->default_);
284+
if (self->default_value != NULL) {
285+
return Py_NewRef(self->default_value);
286286
}
287287
if (self->evaluate_default == NULL) {
288288
Py_RETURN_NONE;
289289
}
290-
PyObject *default_ = PyObject_CallNoArgs(self->evaluate_default);
291-
if (Py_IsNone(default_)) {
292-
default_ = (PyObject *)Py_TYPE(default_);
290+
PyObject *default_value = PyObject_CallNoArgs(self->evaluate_default);
291+
if (Py_IsNone(default_value)) {
292+
default_value = (PyObject *)Py_TYPE(default_value);
293293
}
294-
self->default_ = Py_XNewRef(default_);
295-
return default_;
294+
self->default_value = Py_XNewRef(default_value);
295+
return default_value;
296296
}
297297

298298
static PyObject *
@@ -319,7 +319,7 @@ static PyGetSetDef typevar_getset[] = {
319319
static typevarobject *
320320
typevar_alloc(PyObject *name, PyObject *bound, PyObject *evaluate_bound,
321321
PyObject *constraints, PyObject *evaluate_constraints,
322-
PyObject *default_,
322+
PyObject *default_value,
323323
bool covariant, bool contravariant, bool infer_variance,
324324
PyObject *module)
325325
{
@@ -336,7 +336,7 @@ typevar_alloc(PyObject *name, PyObject *bound, PyObject *evaluate_bound,
336336
tv->evaluate_bound = Py_XNewRef(evaluate_bound);
337337
tv->constraints = Py_XNewRef(constraints);
338338
tv->evaluate_constraints = Py_XNewRef(evaluate_constraints);
339-
tv->default_ = Py_XNewRef(default_);
339+
tv->default_value = Py_XNewRef(default_value);
340340
tv->evaluate_default = NULL;
341341

342342
tv->covariant = covariant;
@@ -361,7 +361,7 @@ typevar.__new__ as typevar_new
361361
name: object(subclass_of="&PyUnicode_Type")
362362
*constraints: object
363363
bound: object = None
364-
default as default_: object = NULL
364+
default as default_value: object = NULL
365365
covariant: bool = False
366366
contravariant: bool = False
367367
infer_variance: bool = False
@@ -371,7 +371,7 @@ Create a TypeVar.
371371

372372
static PyObject *
373373
typevar_new_impl(PyTypeObject *type, PyObject *name, PyObject *constraints,
374-
PyObject *bound, PyObject *default_, int covariant,
374+
PyObject *bound, PyObject *default_value, int covariant,
375375
int contravariant, int infer_variance)
376376
/*[clinic end generated code: output=74ee963663330604 input=2962ee79d92972fc]*/
377377
{
@@ -417,13 +417,13 @@ typevar_new_impl(PyTypeObject *type, PyObject *name, PyObject *constraints,
417417
Py_XDECREF(bound);
418418
return NULL;
419419
}
420-
if (Py_IsNone(default_)) {
421-
default_ = (PyObject *)Py_TYPE(default_);
420+
if (Py_IsNone(default_value)) {
421+
default_value = (PyObject *)Py_TYPE(default_value);
422422
}
423423

424424
PyObject *tv = (PyObject *)typevar_alloc(name, bound, NULL,
425425
constraints, NULL,
426-
default_,
426+
default_value,
427427
covariant, contravariant,
428428
infer_variance, module);
429429
Py_XDECREF(bound);
@@ -844,7 +844,7 @@ paramspec_dealloc(PyObject *self)
844844

845845
Py_DECREF(ps->name);
846846
Py_XDECREF(ps->bound);
847-
Py_XDECREF(ps->default_);
847+
Py_XDECREF(ps->default_value);
848848
Py_XDECREF(ps->evaluate_default);
849849
PyObject_ClearManagedDict(self);
850850
PyObject_ClearWeakRefs(self);
@@ -859,7 +859,7 @@ paramspec_traverse(PyObject *self, visitproc visit, void *arg)
859859
Py_VISIT(Py_TYPE(self));
860860
paramspecobject *ps = (paramspecobject *)self;
861861
Py_VISIT(ps->bound);
862-
Py_VISIT(ps->default_);
862+
Py_VISIT(ps->default_value);
863863
Py_VISIT(ps->evaluate_default);
864864
PyObject_VisitManagedDict(self, visit, arg);
865865
return 0;
@@ -869,7 +869,7 @@ static int
869869
paramspec_clear(paramspecobject *self)
870870
{
871871
Py_CLEAR(self->bound);
872-
Py_CLEAR(self->default_);
872+
Py_CLEAR(self->default_value);
873873
Py_CLEAR(self->evaluate_default);
874874
PyObject_ClearManagedDict((PyObject *)self);
875875
return 0;
@@ -914,18 +914,18 @@ paramspec_kwargs(PyObject *self, void *unused)
914914
static PyObject *
915915
paramspec_default(paramspecobject *self, void *unused)
916916
{
917-
if (self->default_ != NULL) {
918-
return Py_NewRef(self->default_);
917+
if (self->default_value != NULL) {
918+
return Py_NewRef(self->default_value);
919919
}
920920
if (self->evaluate_default == NULL) {
921921
Py_RETURN_NONE;
922922
}
923-
PyObject *default_ = PyObject_CallNoArgs(self->evaluate_default);
924-
if (Py_IsNone(default_)) {
925-
default_ = (PyObject *)Py_TYPE(default_);
923+
PyObject *default_value = PyObject_CallNoArgs(self->evaluate_default);
924+
if (Py_IsNone(default_value)) {
925+
default_value = (PyObject *)Py_TYPE(default_value);
926926
}
927-
self->default_ = Py_XNewRef(default_);
928-
return default_;
927+
self->default_value = Py_XNewRef(default_value);
928+
return default_value;
929929
}
930930

931931
static PyGetSetDef paramspec_getset[] = {
@@ -936,7 +936,7 @@ static PyGetSetDef paramspec_getset[] = {
936936
};
937937

938938
static paramspecobject *
939-
paramspec_alloc(PyObject *name, PyObject *bound, PyObject *default_, bool covariant,
939+
paramspec_alloc(PyObject *name, PyObject *bound, PyObject *default_value, bool covariant,
940940
bool contravariant, bool infer_variance, PyObject *module)
941941
{
942942
PyTypeObject *tp = _PyInterpreterState_GET()->cached_objects.paramspec_type;
@@ -949,7 +949,7 @@ paramspec_alloc(PyObject *name, PyObject *bound, PyObject *default_, bool covari
949949
ps->covariant = covariant;
950950
ps->contravariant = contravariant;
951951
ps->infer_variance = infer_variance;
952-
ps->default_ = Py_XNewRef(default_);
952+
ps->default_value = Py_XNewRef(default_value);
953953
ps->evaluate_default = NULL;
954954
_PyObject_GC_TRACK(ps);
955955
if (module != NULL) {
@@ -968,7 +968,7 @@ paramspec.__new__ as paramspec_new
968968
name: object(subclass_of="&PyUnicode_Type")
969969
*
970970
bound: object = None
971-
default as default_: object = NULL
971+
default as default_value: object = NULL
972972
covariant: bool = False
973973
contravariant: bool = False
974974
infer_variance: bool = False
@@ -978,7 +978,7 @@ Create a ParamSpec object.
978978

979979
static PyObject *
980980
paramspec_new_impl(PyTypeObject *type, PyObject *name, PyObject *bound,
981-
PyObject *default_, int covariant, int contravariant,
981+
PyObject *default_value, int covariant, int contravariant,
982982
int infer_variance)
983983
/*[clinic end generated code: output=b6be5856624d7b5d input=5f16268ae6237a50]*/
984984
{
@@ -1001,11 +1001,11 @@ paramspec_new_impl(PyTypeObject *type, PyObject *name, PyObject *bound,
10011001
Py_XDECREF(bound);
10021002
return NULL;
10031003
}
1004-
if (Py_IsNone(default_)) {
1005-
default_ = (PyObject *)Py_TYPE(default_);
1004+
if (Py_IsNone(default_value)) {
1005+
default_value = (PyObject *)Py_TYPE(default_value);
10061006
}
10071007
PyObject *ps = (PyObject *)paramspec_alloc(
1008-
name, bound, default_, covariant, contravariant, infer_variance, module);
1008+
name, bound, default_value, covariant, contravariant, infer_variance, module);
10091009
Py_XDECREF(bound);
10101010
Py_DECREF(module);
10111011
return ps;
@@ -1164,7 +1164,7 @@ typevartuple_dealloc(PyObject *self)
11641164
typevartupleobject *tvt = (typevartupleobject *)self;
11651165

11661166
Py_DECREF(tvt->name);
1167-
Py_XDECREF(tvt->default_);
1167+
Py_XDECREF(tvt->default_value);
11681168
Py_XDECREF(tvt->evaluate_default);
11691169
PyObject_ClearManagedDict(self);
11701170
PyObject_ClearWeakRefs(self);
@@ -1205,15 +1205,15 @@ static PyMemberDef typevartuple_members[] = {
12051205
};
12061206

12071207
static typevartupleobject *
1208-
typevartuple_alloc(PyObject *name, PyObject *module, PyObject *default_)
1208+
typevartuple_alloc(PyObject *name, PyObject *module, PyObject *default_value)
12091209
{
12101210
PyTypeObject *tp = _PyInterpreterState_GET()->cached_objects.typevartuple_type;
12111211
typevartupleobject *tvt = PyObject_GC_New(typevartupleobject, tp);
12121212
if (tvt == NULL) {
12131213
return NULL;
12141214
}
12151215
tvt->name = Py_NewRef(name);
1216-
tvt->default_ = Py_XNewRef(default_);
1216+
tvt->default_value = Py_XNewRef(default_value);
12171217
tvt->evaluate_default = NULL;
12181218
_PyObject_GC_TRACK(tvt);
12191219
if (module != NULL) {
@@ -1231,23 +1231,23 @@ typevartuple.__new__
12311231
12321232
name: object(subclass_of="&PyUnicode_Type")
12331233
*
1234-
default as default_: object = NULL
1234+
default as default_value: object = NULL
12351235
12361236
Create a new TypeVarTuple with the given name.
12371237
[clinic start generated code]*/
12381238

12391239
static PyObject *
1240-
typevartuple_impl(PyTypeObject *type, PyObject *name, PyObject *default_)
1240+
typevartuple_impl(PyTypeObject *type, PyObject *name, PyObject *default_value)
12411241
/*[clinic end generated code: output=eb847fe0acd69560 input=b2f0ecf512371a75]*/
12421242
{
12431243
PyObject *module = caller();
12441244
if (module == NULL) {
12451245
return NULL;
12461246
}
1247-
if (Py_IsNone(default_)) {
1248-
default_ = (PyObject *)Py_TYPE(default_);
1247+
if (Py_IsNone(default_value)) {
1248+
default_value = (PyObject *)Py_TYPE(default_value);
12491249
}
1250-
PyObject *result = (PyObject *)typevartuple_alloc(name, module, default_);
1250+
PyObject *result = (PyObject *)typevartuple_alloc(name, module, default_value);
12511251
Py_DECREF(module);
12521252
return result;
12531253
}
@@ -1312,7 +1312,7 @@ static int
13121312
typevartuple_traverse(PyObject *self, visitproc visit, void *arg)
13131313
{
13141314
Py_VISIT(Py_TYPE(self));
1315-
Py_VISIT(((typevartupleobject *)self)->default_);
1315+
Py_VISIT(((typevartupleobject *)self)->default_value);
13161316
Py_VISIT(((typevartupleobject *)self)->evaluate_default);
13171317
PyObject_VisitManagedDict(self, visit, arg);
13181318
return 0;
@@ -1321,7 +1321,7 @@ typevartuple_traverse(PyObject *self, visitproc visit, void *arg)
13211321
static int
13221322
typevartuple_clear(PyObject *self)
13231323
{
1324-
Py_CLEAR(((typevartupleobject *)self)->default_);
1324+
Py_CLEAR(((typevartupleobject *)self)->default_value);
13251325
Py_CLEAR(((typevartupleobject *)self)->evaluate_default);
13261326
PyObject_ClearManagedDict(self);
13271327
return 0;
@@ -1330,18 +1330,18 @@ typevartuple_clear(PyObject *self)
13301330
static PyObject *
13311331
typevartuple_default(typevartupleobject *self, void *unused)
13321332
{
1333-
if (self->default_ != NULL) {
1334-
return Py_NewRef(self->default_);
1333+
if (self->default_value != NULL) {
1334+
return Py_NewRef(self->default_value);
13351335
}
13361336
if (self->evaluate_default == NULL) {
13371337
Py_RETURN_NONE;
13381338
}
1339-
PyObject *default_ = PyObject_CallNoArgs(self->evaluate_default);
1340-
if (Py_IsNone(default_)) {
1341-
default_ = (PyObject *)Py_TYPE(default_);
1339+
PyObject *default_value = PyObject_CallNoArgs(self->evaluate_default);
1340+
if (Py_IsNone(default_value)) {
1341+
default_value = (PyObject *)Py_TYPE(default_value);
13421342
}
1343-
self->default_ = Py_XNewRef(default_);
1344-
return default_;
1343+
self->default_value = Py_XNewRef(default_value);
1344+
return default_value;
13451345
}
13461346

13471347
static PyGetSetDef typevartuple_getset[] = {

0 commit comments

Comments
 (0)
0