TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

A Python Guide for the Ages

243 点作者 zombiemama超过 3 年前

13 条评论

adenozine超过 3 年前
I&#x27;m surprised to see mutable default values not mentioned. It&#x27;s bitten me more than once to discover that:<p><pre><code> def f(xs = []): xs.append(5) return xs print(f()) print(f()) </code></pre> will print:<p><pre><code> [5] [5,5] </code></pre> and I love python despite this horrendous decision, but it should be mentioned more often in beginner resources.<p>edit: thanks for the downvote? I&#x27;ve answered on the order of dozens of questions about this very mechanic on SO, via IRC, and more... it&#x27;s a well-known confusing factor
评论 #29683256 未加载
评论 #29683654 未加载
评论 #29684302 未加载
评论 #29690221 未加载
ruph123超过 3 年前
The best cheatsheet which I have ever seen (besides maybe cheats.rs) is this Python cheatsheet by Laurent Pointal, absolutely outstanding in many ways:<p><a href="https:&#x2F;&#x2F;perso.limsi.fr&#x2F;pointal&#x2F;_media&#x2F;python:cours:mementopython3-english.pdf" rel="nofollow">https:&#x2F;&#x2F;perso.limsi.fr&#x2F;pointal&#x2F;_media&#x2F;python:cours:mementopy...</a>
评论 #29681987 未加载
评论 #29686727 未加载
asicsp超过 3 年前
Previous substantial discussion: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=19075325" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=19075325</a> <i>(Feb 4, 2019 | 81 comments)</i><p>Other cheatsheets (excluding learnxinyminutes already mentioned in another comment)<p>* Python Crash Course: <a href="https:&#x2F;&#x2F;ehmatthes.github.io&#x2F;pcc_2e&#x2F;cheat_sheets&#x2F;cheat_sheets&#x2F;" rel="nofollow">https:&#x2F;&#x2F;ehmatthes.github.io&#x2F;pcc_2e&#x2F;cheat_sheets&#x2F;cheat_sheets...</a><p>* Scientific Python: <a href="https:&#x2F;&#x2F;ipgp.github.io&#x2F;scientific_python_cheat_sheet&#x2F;" rel="nofollow">https:&#x2F;&#x2F;ipgp.github.io&#x2F;scientific_python_cheat_sheet&#x2F;</a>
framecowbird超过 3 年前
There are a couple of language features in Python that I thought were cool when I discovered them, but actually have never ever find a need for them in my code. The first is using an &quot;else&quot; clause in a &quot;for&quot; loop, and the second is returning a value from a generator. Curious whether anybody actually uses either of those.
评论 #29681145 未加载
评论 #29680862 未加载
评论 #29681400 未加载
评论 #29681370 未加载
评论 #29682905 未加载
评论 #29682272 未加载
评论 #29686738 未加载
runjake超过 3 年前
I like this.<p>For those of you for whom this list is too terse, check out the excellent LearnXinYminutes site at <a href="https:&#x2F;&#x2F;learnxinyminutes.com&#x2F;docs&#x2F;python&#x2F;" rel="nofollow">https:&#x2F;&#x2F;learnxinyminutes.com&#x2F;docs&#x2F;python&#x2F;</a>
评论 #29681656 未加载
kubb超过 3 年前
I&#x27;m missing type annotations but I think it&#x27;s aa cool cheat sheet.<p>These thing are useful for me who uses python every couple of months. Not often enough to remember it, so I need some reference to refresh my memory.
mark_l_watson超过 3 年前
Thanks for whoever did this, a nice resource! I have been forced to use Python for many years because I am mostly payed to do deep learning. I really enjoyed carefully reading through this. Good job.
tux超过 3 年前
Very nice detailed cheatsheet thank you! Every programming language should have similar cheatsheet.
darkbatman超过 3 年前
Does someone know similar guide for javascript&#x2F;node.js or its a good thing to start one?
评论 #29683114 未加载
abhishekjha超过 3 年前
I love that it is easily printable from the browser, just CTRL+P.
phoenix24超过 3 年前
does anyone have recommendations for a good ruby cheatsheet?
评论 #29683105 未加载
gorgoiler超过 3 年前
<i>Integral</i>?
hereforphone超过 3 年前
&quot;For the ages&quot;. Or at least until they release Python 4
评论 #29684830 未加载