Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2cf4738 commit 73dc1c6Copy full SHA for 73dc1c6
1 file changed
Lib/test/test_generators.py
@@ -6,6 +6,7 @@
6
import unittest
7
import weakref
8
import inspect
9
+import types
10
11
from test import support
12
@@ -89,9 +90,12 @@ def gen():
89
90
self.assertEqual(gc.garbage, old_garbage)
91
92
def test_lambda_generator(self):
- # Issue #23192: Test that a lambda returning a generator behaves
93
+ # bpo-23192, gh-119897: Test that a lambda returning a generator behaves
94
# like the equivalent function
95
f = lambda: (yield 1)
96
+ self.assertIsInstance(f(), types.GeneratorType)
97
+ self.assertEqual(next(f()), 1)
98
+
99
def g(): return (yield 1)
100
101
# test 'yield from'
0 commit comments