diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2024-01-17 23:39:12 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-18 04:39:12 +0000 |
commit | 6f4b242a03e521a55f0b9e440703b424ed18ce2f (patch) | |
tree | 8304999801f3e5d3dd51085c0c1771fd3c24c3ae /Lib/idlelib/debugger_r.py | |
parent | 8cda72037b262772399b2b7fc36dee9340d74fd6 (diff) | |
download | cpython-6f4b242a03e521a55f0b9e440703b424ed18ce2f.tar.gz cpython-6f4b242a03e521a55f0b9e440703b424ed18ce2f.zip |
gh-96905: In IDLE code, stop redefining built-ins 'dict' and 'object' (#114227)
Prefix 'dict' with 'o', 'g', or 'l' for 'object', 'global', or 'local'.
Suffix 'object' with '_'.
Diffstat (limited to 'Lib/idlelib/debugger_r.py')
-rw-r--r-- | Lib/idlelib/debugger_r.py | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/Lib/idlelib/debugger_r.py b/Lib/idlelib/debugger_r.py index 26204438858..ad3355d9f82 100644 --- a/Lib/idlelib/debugger_r.py +++ b/Lib/idlelib/debugger_r.py @@ -125,16 +125,16 @@ class IdbAdapter: def frame_globals(self, fid): frame = frametable[fid] - dict = frame.f_globals - did = id(dict) - dicttable[did] = dict + gdict = frame.f_globals + did = id(gdict) + dicttable[did] = gdict return did def frame_locals(self, fid): frame = frametable[fid] - dict = frame.f_locals - did = id(dict) - dicttable[did] = dict + ldict = frame.f_locals + did = id(ldict) + dicttable[did] = ldict return did def frame_code(self, fid): @@ -158,20 +158,17 @@ class IdbAdapter: def dict_keys(self, did): raise NotImplementedError("dict_keys not public or pickleable") -## dict = dicttable[did] -## return dict.keys() +## return dicttable[did].keys() - ### Needed until dict_keys is type is finished and pickealable. + ### Needed until dict_keys type is finished and pickleable. + # xxx finished. pickleable? ### Will probably need to extend rpc.py:SocketIO._proxify at that time. def dict_keys_list(self, did): - dict = dicttable[did] - return list(dict.keys()) + return list(dicttable[did].keys()) def dict_item(self, did, key): - dict = dicttable[did] - value = dict[key] - value = reprlib.repr(value) ### can't pickle module 'builtins' - return value + value = dicttable[did][key] + return reprlib.repr(value) # Can't pickle module 'builtins'. #----------end class IdbAdapter---------- |