Submission timeline
2007–2026One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.
First comments on top threads
HN comment orderI like the basic script template that the author provides. However, when I start development of new code I always use a script that starts off with traceback and pdb, something like this: #!/usr/bin/env python import traceback import pdb import sys def main(): # some WIP code that maybe raises an exception raise BaseException("oh no, exception!") return 0 if __name__ == "__main__": try: ret = main() except: traceback.print_exc() pdb.post_mortem() sys.exit(ret) This means that whenever an uncaught exception gets…
Previous discussion: https://news.ycombinator.com/item?id=29679788 (243 points | Dec 25, 2021 | 57 comments) See also: * Python Crash Course cheatsheet: https://ehmatthes.github.io/pcc_3e/cheat_sheets/ * Scientific Python cheatsheet: https://ipgp.github.io/scientific_python_cheat_sheet/ * Common beginner errors: https://pythonforbiologists.com/29-common-beginner-errors-on... * Python regular expression cheatsheet: https://learnbyexample.github.io/python-regex-cheatsheet/ — my blog post, includes examples as well
I'm surprised to see mutable default values not mentioned. It's bitten me more than once to discover that: def f(xs = []): xs.append(5) return xs print(f()) print(f()) will print: [5] [5,5] and I love python despite this horrendous decision, but it should be mentioned more often in beginner resources. edit: thanks for the downvote? I've answered on the order of dozens of questions about this very mechanic on SO, via IRC, and more... it's a well-known confusing factor
Source: https://www.cs.princeton.edu/courses/archive/spring19/cos333...
The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.
- Breakout years
- 3
- Total points
- 899
- Total comments
- 179
100+ points or 50+ comments
reference only — not used in Hall rules or ranking
reference only — not used in Hall rules or ranking
Every submission
| Date | Title as submitted | By | Points | Comments |
|---|---|---|---|---|
| 2018-12-27 | A comprehensive Python cheatsheet | sidcool | 6 | 0 |
| 2019-02-04 | Comprehensive Python Cheatsheet (2018)First breakout · Best thread | pizzaburek | 335 | 81 |
| 2019-07-11 | Best Python Cheatsheet Ever | pizzaburek | 3 | 0 |
| 2020-06-29 | Comprehensive Python CheatSheet, now with Pandas and more libraries | chirau | 5 | 0 |
| 2020-11-03 | Comprehensive Python Cheatsheet | signa11 | 2 | 0 |
| 2020-12-25 | Comprehensive Python Cheatsheet (2020) | zombiemama | 4 | 0 |
| 2020-12-26 | “A helpful (Python) cheat sheet, quite long.” ― Brian Kernighan | zombiemama | 3 | 1 |
| 2021-12-25 | A Python Guide for the AgesHall induction | zombiemama | 243 | 57 |
| 2023-07-20 | Comprehensive Python “Cheatsheet”Latest 20+ point return | zombiemama | 295 | 40 |
| 2024-10-17 | Python Cheatsheet | zombiemama | 1 | 0 |
| 2024-10-18 | Comprehensive Python Cheatsheet | zombiemama | 2 | 0 |
