From 044ce7be360fd457d09efccd86eff9f36a1ded01 Mon Sep 17 00:00:00 2001 From: evdakim1234 <95436071+evdakim1234@users.noreply.github.com> Date: Thu, 3 Sep 2026 02:35:14 +0300 Subject: [PATCH 1/2] UNUSED_VALUE replacing unused variables with _ --- Lib/_markupbase.py | 6 +++--- Lib/idlelib/multicall.py | 4 ++-- Lib/turtle.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Lib/_markupbase.py b/Lib/_markupbase.py index 3ad7e279960f7e1..2d0ab4c6dfdb08f 100644 --- a/Lib/_markupbase.py +++ b/Lib/_markupbase.py @@ -221,7 +221,7 @@ def _parse_doctype_subset(self, i, declstartpos): if (j + 1) == n: # end of buffer; incomplete return -1 - s, j = self._scan_name(j + 1, declstartpos) + _, j = self._scan_name(j + 1, declstartpos) if j < 0: return j if rawdata[j] == ";": @@ -286,7 +286,7 @@ def _parse_doctype_attlist(self, i, declstartpos): # end of buffer, incomplete return -1 else: - name, j = self._scan_name(j, declstartpos) + _, j = self._scan_name(j, declstartpos) c = rawdata[j:j+1] if not c: return -1 @@ -303,7 +303,7 @@ def _parse_doctype_attlist(self, i, declstartpos): if rawdata[j:] == "#": # end of buffer return -1 - name, j = self._scan_name(j + 1, declstartpos) + _, j = self._scan_name(j + 1, declstartpos) if j < 0: return j c = rawdata[j:j+1] diff --git a/Lib/idlelib/multicall.py b/Lib/idlelib/multicall.py index 95f4fee7fbe740a..70d40e387eedef0 100644 --- a/Lib/idlelib/multicall.py +++ b/Lib/idlelib/multicall.py @@ -192,7 +192,7 @@ def __init__(self, type, widget, widgetinst): self.typename = _types[type][0] self.widget = widget self.widgetinst = widgetinst - self.bindedfuncs = {None: [[] for s in _states]} + self.bindedfuncs = {None: [[] for _ in _states]} self.handlerids = [] # we don't want to change the lists of functions while a handler is # running - it will mess up the loop and anyway, we usually want the @@ -212,7 +212,7 @@ def __init__(self, type, widget, widgetinst): def bind(self, triplet, func): if triplet[2] not in self.bindedfuncs: - self.bindedfuncs[triplet[2]] = [[] for s in _states] + self.bindedfuncs[triplet[2]] = [[] for _ in _states] for s in _states: lists = [ self.bindedfuncs[detail][i] for detail in (triplet[2], None) diff --git a/Lib/turtle.py b/Lib/turtle.py index a58c1ce1e04ccbd..8d2e085abb49ecf 100644 --- a/Lib/turtle.py +++ b/Lib/turtle.py @@ -4092,7 +4092,7 @@ def demo1(): write("start", 1) color("red") # staircase - for i in range(5): + for _ in range(5): forward(20) left(90) forward(20) From 8014f7b79335fa06ada028b865868d29331d736d Mon Sep 17 00:00:00 2001 From: evdakim1234 <95436071+evdakim1234@users.noreply.github.com> Date: Thu, 3 Sep 2026 02:47:16 +0300 Subject: [PATCH 2/2] UNUSED_VALUE removed unused map() execution logic --- Lib/idlelib/searchengine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/idlelib/searchengine.py b/Lib/idlelib/searchengine.py index ceb38cfaef900ba..62fc83ede423af3 100644 --- a/Lib/idlelib/searchengine.py +++ b/Lib/idlelib/searchengine.py @@ -180,7 +180,7 @@ def search_backward(self, text, prog, line, col, wrap, ok=0): wrapped = 1 wrap = 0 pos = text.index("end-1c") - line, col = map(int, pos.split(".")) + line = int(pos.split(".")[0]) chars = text.get("%d.0" % line, "%d.0" % (line+1)) col = len(chars) - 1 return None