Skip to content

Commit a52f82b

Browse files
authored
bpo-46920: Remove disabled debug code added decades ago and likely unnecessary (GH-31812)
1 parent e885ac3 commit a52f82b

File tree

3 files changed

+0
-42
lines changed

3 files changed

+0
-42
lines changed

Objects/unicodeobject.c

-13
Original file line numberDiff line numberDiff line change
@@ -13623,14 +13623,6 @@ unicode_zfill_impl(PyObject *self, Py_ssize_t width)
1362313623
return u;
1362413624
}
1362513625

13626-
#if 0
13627-
static PyObject *
13628-
unicode__decimal2ascii(PyObject *self)
13629-
{
13630-
return PyUnicode_TransformDecimalAndSpaceToASCII(self);
13631-
}
13632-
#endif
13633-
1363413626
PyDoc_STRVAR(startswith__doc__,
1363513627
"S.startswith(prefix[, start[, end]]) -> bool\n\
1363613628
\n\
@@ -14216,11 +14208,6 @@ static PyMethodDef unicode_methods[] = {
1421614208
UNICODE___FORMAT___METHODDEF
1421714209
UNICODE_MAKETRANS_METHODDEF
1421814210
UNICODE_SIZEOF_METHODDEF
14219-
#if 0
14220-
/* These methods are just used for debugging the implementation. */
14221-
{"_decimal2ascii", (PyCFunction) unicode__decimal2ascii, METH_NOARGS},
14222-
#endif
14223-
1422414211
{"__getnewargs__", unicode_getnewargs, METH_NOARGS},
1422514212
{NULL, NULL}
1422614213
};

Parser/pegen.c

-11
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,6 @@ _PyPegen_byte_offset_to_character_offset(PyObject *line, Py_ssize_t col_offset)
3737
return size;
3838
}
3939

40-
#if 0
41-
static const char *
42-
token_name(int type)
43-
{
44-
if (0 <= type && type <= N_TOKENS) {
45-
return _PyParser_TokenNames[type];
46-
}
47-
return "<Huh?>";
48-
}
49-
#endif
50-
5140
// Here, mark is the start of the node, while p->mark is the end.
5241
// If node==NULL, they should be the same.
5342
int

Python/formatter_unicode.c

-18
Original file line numberDiff line numberDiff line change
@@ -137,24 +137,6 @@ typedef struct {
137137
Py_UCS4 type;
138138
} InternalFormatSpec;
139139

140-
#if 0
141-
/* Occasionally useful for debugging. Should normally be commented out. */
142-
static void
143-
DEBUG_PRINT_FORMAT_SPEC(InternalFormatSpec *format)
144-
{
145-
printf("internal format spec: fill_char %d\n", format->fill_char);
146-
printf("internal format spec: align %d\n", format->align);
147-
printf("internal format spec: alternate %d\n", format->alternate);
148-
printf("internal format spec: sign %d\n", format->sign);
149-
printf("internal format spec: width %zd\n", format->width);
150-
printf("internal format spec: thousands_separators %d\n",
151-
format->thousands_separators);
152-
printf("internal format spec: precision %zd\n", format->precision);
153-
printf("internal format spec: type %c\n", format->type);
154-
printf("\n");
155-
}
156-
#endif
157-
158140

159141
/*
160142
ptr points to the start of the format_spec, end points just past its end.

0 commit comments

Comments
 (0)