summaryrefslogtreecommitdiffstats
path: root/Lib/test/inspect_fodder2.py
diff options
context:
space:
mode:
authorTian Gao <gaogaotiantian@hotmail.com>2023-07-18 23:20:31 (GMT)
committerGitHub <noreply@github.com>2023-07-18 23:20:31 (GMT)
commit663854d73b35feeb004ae0970e45b53ca27774a1 (patch)
tree24f61e97f387c4e1168672b75633f7ca8c8d29c2 /Lib/test/inspect_fodder2.py
parent505eede38d141d43e40e246319b157e3c77211d3 (diff)
downloadcpython-663854d73b35feeb004ae0970e45b53ca27774a1.zip
cpython-663854d73b35feeb004ae0970e45b53ca27774a1.tar.gz
cpython-663854d73b35feeb004ae0970e45b53ca27774a1.tar.bz2
gh-106727: Make `inspect.getsource` smarter for class for same name definitions (#106815)
Diffstat (limited to 'Lib/test/inspect_fodder2.py')
-rw-r--r--Lib/test/inspect_fodder2.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/Lib/test/inspect_fodder2.py b/Lib/test/inspect_fodder2.py
index 0346461..8639cf2 100644
--- a/Lib/test/inspect_fodder2.py
+++ b/Lib/test/inspect_fodder2.py
@@ -290,3 +290,23 @@ post_line_parenthesized_lambda1 = (lambda: ()
nested_lambda = (
lambda right: [].map(
lambda length: ()))
+
+# line 294
+if True:
+ class cls296:
+ def f():
+ pass
+else:
+ class cls296:
+ def g():
+ pass
+
+# line 304
+if False:
+ class cls310:
+ def f():
+ pass
+else:
+ class cls310:
+ def g():
+ pass