docs.python.org favicon

itertools — Functions creating iterators for efficient looping — Python 3.14.7 documentation

itertools — Functions creating iterators for efficient looping — Python 3.14.7 documentation

#7
24
公开标注数
7
参与人数
2026-07-17 10:00:18
首次 Whisper

讨论活跃度

docs.python.org 近 17 周的公开 Whisper

6 活跃天数

最新公开 Whisper

RSS
划选高亮2026-08-11 03:09:57
原文高亮摘录
List comprehensions provide a concise way to create lists.
Whisper 随想笔记
List comprehensions are such a game changer, way cleaner than loops.
划选高亮2026-08-06 03:09:18
原文高亮摘录
this is the correct code.
Whisper 随想笔记
lol that else always trips me up, good catch.
划选高亮2026-07-27 12:40:15
原文高亮摘录
since it often causes poorly readable code.
Whisper 随想笔记
I only use * in the REPL, it's too handy to give up there.
划选高亮2026-07-27 12:31:15
原文高亮摘录
since it often causes poorly readable code.
Whisper 随想笔记
Yeah, wildcard imports make it impossible to know where names come from.
划选高亮2026-07-27 09:37:15
原文高亮摘录
A module is a file containing Python definitions and statements.
Whisper 随想笔记
I always wondered why __name__ showed up in scripts. Now it makes sense.
划选高亮2026-07-27 09:28:15
原文高亮摘录
A module is a file containing Python definitions and statements.
Whisper 随想笔记
Wait, so if I just write some functions in a file, I can import them anywhere? Cool.
划选高亮2026-07-27 09:19:15
原文高亮摘录
A module is a file containing Python definitions and statements.
Whisper 随想笔记
So basically any .py file is a module? That's simpler than I thought.
划选高亮2026-07-26 15:43:07
原文高亮摘录
Assignments do not copy data — they just bind names to objects.
Whisper 随想笔记
So that's why my list changes when I pass it to a function and modify it inside... makes sense now.
划选高亮2026-07-26 12:40:07
原文高亮摘录
A namespace is a mapping from names to objects.
Whisper 随想笔记
Wait, so doesn't that mean functions and variables are just keys? Mind blown.
划选高亮2026-07-26 12:31:07
原文高亮摘录
A namespace is a mapping from names to objects.
Whisper 随想笔记
So basically it's just a fancy word for a dictionary, got it.
划选高亮2026-07-26 09:37:07
原文高亮摘录
Classes provide a means of bundling data and functionality together.
Whisper 随想笔记
Yeah, but the real magic is when you get to override methods and mess with state.
划选高亮2026-07-26 09:28:07
原文高亮摘录
Classes provide a means of bundling data and functionality together.
Whisper 随想笔记
That's the whole point? I thought classes were about inheritance and stuff.
划选高亮2026-07-26 09:19:07
原文高亮摘录
Classes provide a means of bundling data and functionality together.
Whisper 随想笔记
So basically it's just grouping stuff with the functions that use it, neat.
划选高亮2026-07-18 16:10:52
原文高亮摘录
there are no easy answers
Whisper 随想笔记
Yeah, but knowing that doesn't make debugging floats any less painful.
划选高亮2026-07-18 13:07:52
原文高亮摘录
0.1 cannot be represented exactly as a base 2 fraction
Whisper 随想笔记
Wait, but my calculator shows 0.1 fine, so why does Python have this problem? Seems like a bug.
划选高亮2026-07-18 12:58:52
原文高亮摘录
0.1 cannot be represented exactly as a base 2 fraction
Whisper 随想笔记
So that's why 0.1 + 0.2 is never exactly 0.3, it's kind of mind-blowing when you first get it.
划选高亮2026-07-18 10:04:52
原文高亮摘录
Unfortunately
Whisper 随想笔记
I learned this the hard way when my accounting calc broke.
划选高亮2026-07-18 09:55:52
原文高亮摘录
Unfortunately
Whisper 随想笔记
But like, does it really matter for most apps though?
划选高亮2026-07-18 09:46:52
原文高亮摘录
Unfortunately
Whisper 随想笔记
Yeah, 0.1 + 0.2 still hits me every time.
划选高亮2026-07-17 13:21:18
原文高亮摘录
The following functions all construct and return iterators.
Whisper 随想笔记
Yeah, that's the whole point — just make sure you don't forget to break.

看看大家在 docs.python.org 上划了什么重点

安装 DomWhisper,浏览网页时实时查看 whisper,也可以加入讨论。

获取插件