diff options
author | Carl Meyer <carl@oddbird.net> | 2023-05-09 17:02:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-09 17:02:14 (GMT) |
commit | c3b595e73efac59360d6dc869802abc752092460 (patch) | |
tree | 5095460e4d502af2688c132562b7d8570f33d7b0 /Lib/test/test_inspect.py | |
parent | 0aeda297931820436a50b78f4f7f0597274b5df4 (diff) | |
download | cpython-c3b595e73efac59360d6dc869802abc752092460.zip cpython-c3b595e73efac59360d6dc869802abc752092460.tar.gz cpython-c3b595e73efac59360d6dc869802abc752092460.tar.bz2 |
gh-97933: (PEP 709) inline list/dict/set comprehensions (#101441)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r-- | Lib/test/test_inspect.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index d2b2f31..364f75d 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -4280,14 +4280,14 @@ class TestSignatureBind(unittest.TestCase): @cpython_only def test_signature_bind_implicit_arg(self): - # Issue #19611: getcallargs should work with set comprehensions + # Issue #19611: getcallargs should work with comprehensions def make_set(): - return {z * z for z in range(5)} - setcomp_code = make_set.__code__.co_consts[1] - setcomp_func = types.FunctionType(setcomp_code, {}) + return set(z * z for z in range(5)) + gencomp_code = make_set.__code__.co_consts[1] + gencomp_func = types.FunctionType(gencomp_code, {}) iterator = iter(range(5)) - self.assertEqual(self.call(setcomp_func, iterator), {0, 1, 4, 9, 16}) + self.assertEqual(set(self.call(gencomp_func, iterator)), {0, 1, 4, 9, 16}) def test_signature_bind_posonly_kwargs(self): def foo(bar, /, **kwargs): |