临时上传,仍在开发过程中

This commit is contained in:
2026-02-02 01:33:47 +08:00
parent 0de959c396
commit 841f6e53c6
20 changed files with 1332 additions and 965 deletions

View File

@@ -0,0 +1,21 @@
# 模拟两种写法
def method_A(self, start, end):
yield from (f"{track}.get_range(start, end)" for track in self)
def method_B(self, start, end):
return (f"{track}.get_range(start, end)" for track in self)
tracks = ["A", "B"]
gen_a = method_A(tracks, 0, 10)
print(list(gen_a))
gen_b = method_B(tracks, 0, 10)
print(list(gen_b))
# they are the same output