1 SUSPECT #1
import asyncio
async def gen():
for i in range(3):
yield i
async def main():
async for n in gen():
print(n)
asyncio.run(main()) # (no error)
0
1
2 2 SUSPECT #2
from dataclasses import dataclass, asdict
@dataclass
class User:
name: str
age: int
u = User("Ada", 36)
print(asdict(u)) # (no error)
{'name': 'Ada', 'age': 36} 3 SUSPECT #3
import sys
print(sys.float_info.max > 1e308, sys.float_info.min < 1e-307) # (no error)
True True 4 SUSPECT #4
import asyncio
async def outer():
async def inner():
for i in range(3):
yield i
yield from inner()
async def main():
async for n in outer():
print(n)
asyncio.run(main()) Traceback (most recent call last):
File "lineup.py", line 11, in <module>
asyncio.run(main())
File "lineup.py", line 7, in outer
yield from inner()
TypeError: 'async_generator' object is not iterable 5 SUSPECT #5
from typing import Self
class Node:
def link_to(self, other: "Node") -> "Node":
self.next = other
return self
a = Node().link_to(Node()).link_to(Node())
print(type(a).__name__) # (no error β fluent-chain pattern works)
Node