Repository navigation
Remove code made dead long ago with #if 0 #91076
Description
Activity
git grep "#if 0"gives the following occurences of dead code (analyzed withgit blame, removed by a linked pull request):-
added on 27 Apr 2020 by 2b74c83: Parser/pegen.h:9, Parser/pegen.h:15. Since these constants aren't mentioned anywhere else, I think it's some initial experiment now abandoned.
-
added on 23 Apr 2020 by c5fc156: Parser/pegen.c:40.
token_nameis mentioned nowhere in the CPython codebase too. -
added on 20 Nov 2014 by d600951: Python/pylifecycle.c:1843 with the following note:
> XXX This is disabled because it caused too many problems. If a __del__ or weakref callback triggers here, Python code has a hard time running, because even the sys module has been cleared out (sys.stdout is gone, sys.excepthook is gone, etc). One symptom is a sequence of information-free messages coming from threads (if a __del__ or callback is invoked, other threads can execute too, and any exception they encounter triggers a comedy of errors as subsystem after subsystem fails to find what it *expects* to find in sys to help report the exception and consequent unexpected failures). I've also seen segfaults then, after adding print statements to the Python code getting called.
So the call is faulty for seven years with no progress.
-
added on 26 Oct 2013 by 8444ebb: Modules/sre_lib.h336. The Secret Labs' Regular Expression Engine was vendored nine years ago so
not used in this releaseis permanent and can be removed. -
added on 25 Aug 2012 by 2543756: Modules/_ctypes/libffi_osx/x86/x86-ffi64.c:155
-
added on 21 Mar 2012 by 1919b7e: Modules/_decimal/libmpdec/sixstep.c:120, Modules/_decimal/libmpdec/sixstep.c:157, Modules/_decimal/libmpdec/fourstep.c:189, Modules/_decimal/libmpdec/fourstep.c:220
-
added on 28 Sep 2011 by d63a3b8: Python/formatter_unicode.c:140.
DEBUG_PRINT_FORMAT_SPECis used nowhere, plus putting a debugger breakpoint onto an interestingInternalFormatSpecis more convenient. -
added on 5 Mar 2008 by 7864476: Modules/_ctypes/libffi_osx/powerpc/ppc-ffi_darwin.c:40
-
added on 27 Aug 2007 by e226b55: Objects/unicodeobject.c:13660, Objects/unicodeobject.c:14253.
_decimal2asciiis mentioned nowhere else in the CPython codebase. -
added on 11 Aug 2006 by 0e3f591: Python/compile.c:7873. Neither
dump_instrnordump_basicblockare used. -
added on 7 Dec 2005 by 8c8836b: Modules/_elementtree.c:39. In addition,
ALLOC()andRELEASE()are removed as unconditional no-ops. -
added on 4 Aug 2002 by 00f1e3f: Parser/tokenizer.c:285. "/* Disable support for UTF-16 BOMs until a decision is made whether this needs to be supported */" - I have every reason to believe that the decision was Never Ever.
-
added on 23 Mar 2002 by c24ea08: Python/ceval.c:7065-L7070. The "/* future keyword */" is quite overdue already.
-
added on 23 Jun 2001 by 01dfdb3: Modules/getaddrinfo.c:41, Modules/getnameinfo.c:37
-
added on 14 Jul 1998 by 43ff868: Modules/_tkinter.c:3443
-
- added3.11only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)extension-modulesC modules in the Modules dirC modules in the Modules dirtype-featureA feature request or enhancementA feature request or enhancement
on Mar 4, 2022 Also forgot to add that git grep "#if 1" gives the following:
- added on 20 Nov 2014 by d600951: cpython/Python/pylifecycle.c:2427. "/* Disable this if you have trouble debugging bootstrap stuff */" - after seven years, no trouble was found so this always-true guard has no use.
I reverted my changes in Modules/_ctypes/libffi_osx/x86/x86-ffi64.c and Modules/_decimal/libmpdec/*step.c to not disturb third-party vendored libraries.
As a result, macOS component is no longer affected along with the corresponding experts in a nosy list.
Can this issue be closed? Or is there remaining dead code that you want to remove?
Thanks Oleg Iarygin for the cleanup!
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields: