]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46920: Remove disabled debug code added decades ago and likely unnecessary ...
authorOleg Iarygin <oleg@arhadthedev.net>
Mon, 14 Mar 2022 16:03:21 +0000 (19:03 +0300)
committerGitHub <noreply@github.com>
Mon, 14 Mar 2022 16:03:21 +0000 (17:03 +0100)
Objects/unicodeobject.c
Parser/pegen.c
Python/formatter_unicode.c

index 2261b9a0316259bb60d48737705f21dc2bafc2d4..5dfe6e1e93f9f7396f14f22779eaec02f1a97fa4 100644 (file)
@@ -13623,14 +13623,6 @@ unicode_zfill_impl(PyObject *self, Py_ssize_t width)
     return u;
 }
 
-#if 0
-static PyObject *
-unicode__decimal2ascii(PyObject *self)
-{
-    return PyUnicode_TransformDecimalAndSpaceToASCII(self);
-}
-#endif
-
 PyDoc_STRVAR(startswith__doc__,
              "S.startswith(prefix[, start[, end]]) -> bool\n\
 \n\
@@ -14216,11 +14208,6 @@ static PyMethodDef unicode_methods[] = {
     UNICODE___FORMAT___METHODDEF
     UNICODE_MAKETRANS_METHODDEF
     UNICODE_SIZEOF_METHODDEF
-#if 0
-    /* These methods are just used for debugging the implementation. */
-    {"_decimal2ascii", (PyCFunction) unicode__decimal2ascii, METH_NOARGS},
-#endif
-
     {"__getnewargs__",  unicode_getnewargs, METH_NOARGS},
     {NULL, NULL}
 };
index 95dc54dd6040fa6bdee3c49b8d3fb0c65af26694..143461d44a1a4a2afedb04e5d1127c69a059f6c3 100644 (file)
@@ -37,17 +37,6 @@ _PyPegen_byte_offset_to_character_offset(PyObject *line, Py_ssize_t col_offset)
     return size;
 }
 
-#if 0
-static const char *
-token_name(int type)
-{
-    if (0 <= type && type <= N_TOKENS) {
-        return _PyParser_TokenNames[type];
-    }
-    return "<Huh?>";
-}
-#endif
-
 // Here, mark is the start of the node, while p->mark is the end.
 // If node==NULL, they should be the same.
 int
index 0c21301fb9ed4b3a57bf230e3f7316e5c8c5f8d7..a1e50e20c9d8c66065cb674c1dfe5438c6705105 100644 (file)
@@ -137,24 +137,6 @@ typedef struct {
     Py_UCS4 type;
 } InternalFormatSpec;
 
-#if 0
-/* Occasionally useful for debugging. Should normally be commented out. */
-static void
-DEBUG_PRINT_FORMAT_SPEC(InternalFormatSpec *format)
-{
-    printf("internal format spec: fill_char %d\n", format->fill_char);
-    printf("internal format spec: align %d\n", format->align);
-    printf("internal format spec: alternate %d\n", format->alternate);
-    printf("internal format spec: sign %d\n", format->sign);
-    printf("internal format spec: width %zd\n", format->width);
-    printf("internal format spec: thousands_separators %d\n",
-           format->thousands_separators);
-    printf("internal format spec: precision %zd\n", format->precision);
-    printf("internal format spec: type %c\n", format->type);
-    printf("\n");
-}
-#endif
-
 
 /*
   ptr points to the start of the format_spec, end points just past its end.