mirror of
https://github.com/python/cpython.git
synced 2025-07-15 23:35:23 +00:00
[3.11] gh-96905: In IDLE code, stop redefining built-ins 'dict' and 'object' (GH-114227) (#114229)
Prefix 'dict' with 'o', 'g', or 'l' for 'object', 'global', or 'local'.
Suffix 'object' with '_'.
(cherry picked from commit 6f4b242a03
)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This commit is contained in:
parent
4ec2e2eeee
commit
f49a1ce6b2
8 changed files with 45 additions and 42 deletions
|
@ -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----------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue