AI-Guided Rereading - Python Cookbook 3rd Edition

If I had to parse Kant pre-AI, but post-GPT still can’t comprehend, isn’t that like bringing a quantum computer to an abacus convention?
AI没来的时候跪着看这些书, AI来了还看不懂,那AI不是白来了吗?

When AI cometh, the binary dawn shall brighten our skies!
AI来了,青天就有了

CHAPTER 1. Data Structures and Algorithms

1.2. Unpacking Elements from Iterables of Arbitrary Length

star unpacking

完整代码示例可参考 GitHub 仓库:star_unpacking_and_yield.py

星号解压语法中,一个赋值语句只能出现一次*,想来也是,不然就成了指代不明。

1
2
3
record = ('Dave', 'dave@example.com', '773-555-1212', '847-555-1212')
name, email, *phone_numbers = record
print(phone_numbers) # ['773-555-1212', '847-555-1212']

AI-Guided Rereading - Python Cookbook 3rd Edition
https://gou7ma7.github.io/2025/05/25/book/Python_Cookbook_3rd_Edition/
作者
Roy Lee
发布于
2025年5月25日
许可协议