aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/dis.py
diff options
context:
space:
mode:
authorAlexandr Mitin <64941904+Alexandr153@users.noreply.github.com>2024-08-28 12:15:34 +0600
committerGitHub <noreply@github.com>2024-08-28 09:15:34 +0300
commit6a7765b9fad8bf67e2c118b637a516c5e6c42349 (patch)
tree5b4b7037e600a93f346308aed4480bb696bc3c0d /Lib/dis.py
parent2231286d78d328c2f575e0b05b16fe447d1656d6 (diff)
downloadcpython-6a7765b9fad8bf67e2c118b637a516c5e6c42349.tar.gz
cpython-6a7765b9fad8bf67e2c118b637a516c5e6c42349.zip
gh-123363: Show string value of CONTAINS_OP oparg in dis (#123387)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Diffstat (limited to 'Lib/dis.py')
-rw-r--r--Lib/dis.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/dis.py b/Lib/dis.py
index bdac296e9c7..f8832b30497 100644
--- a/Lib/dis.py
+++ b/Lib/dis.py
@@ -52,6 +52,7 @@ LOAD_FAST_LOAD_FAST = opmap['LOAD_FAST_LOAD_FAST']
STORE_FAST_LOAD_FAST = opmap['STORE_FAST_LOAD_FAST']
STORE_FAST_STORE_FAST = opmap['STORE_FAST_STORE_FAST']
IS_OP = opmap['IS_OP']
+CONTAINS_OP = opmap['CONTAINS_OP']
CACHE = opmap["CACHE"]
@@ -632,6 +633,8 @@ class ArgResolver:
argrepr = _special_method_names[arg]
elif deop == IS_OP:
argrepr = 'is not' if argval else 'is'
+ elif deop == CONTAINS_OP:
+ argrepr = 'not in' if argval else 'in'
return argval, argrepr
def get_instructions(x, *, first_line=None, show_caches=None, adaptive=False):