Brett Cannon
snarky.ca · Personal blog · on HN since 2015
Brett Cannon, a Python core developer, writes about Python's history, language internals, packaging tools, and the social side of open source maintenance.
What HN saysCommenters recommend his Syntactic Sugar series for how Python features work and cite his posts on open source maintainer burnout and expectations.
100HN people shared it
35linked it in comments
157stories submitted
2.6Kstory points
3 months agolast shared
2015people per year2026
Most-shared posts
- 1The history behind the decision to move Python to GitHub13 people · 84 points · first shared 2016 · 27 comments on HN
- 2Why Python 3 Exists7 people · 420 points · first shared 2015 · 266 comments on HN
- 3Brett Cannon's proposal for a struct syntax for Python7 people · 9 points · first shared 2023 · 1 comments on HN
- 4Why to use ‘python -m pip’6 people · 266 points · first shared 2019 · 135 comments on HN
- 5The social contract of open source6 people · 37 points · first shared 2021 · 2 comments on HN
- 6The Python Launcher for Unix6 people · 19 points · first shared 2021 · discussion on HN
- 7How async/await works in Python 3.55 people · 65 points · first shared 2016 · 10 comments on HN
- 8Taking a month off from OSS volunteering4 people · 237 points · first shared 2016 · 179 comments on HN
- 9What is the core of the Python programming language?4 people · 237 points · first shared 2020 · 129 comments on HN
- 10What the Heck Is Pyproject.toml?4 people · 133 points · first shared 2020 · 194 comments on HN
- 11Why `print` became a function in Python 34 people · 60 points · first shared 2016 · 34 comments on HN
- 12Setting expectations for open source participation (2018)4 people · 47 points · first shared 2018 · 13 comments on HN
- 13How to pitch Python 3 to management4 people · 6 points · first shared 2016 · discussion on HN
- 14Classifying Python virtual environment workflows4 people · 4 points · first shared 2023 · discussion on HN
- 15How I stay happy making open source software3 people · 117 points · first shared 2015 · 34 comments on HN
What HN people wrote when they linked it
mattip · 2020-12-12
Please open a documentation issue at https://github.com/numpy/numpy/issues describing exactly which internals you would like to see explained: indexing, ufuncs, linkage, random, dtypes, ... and what format you would like to see the documentation in: text, video, lessons with questions/answers, ...
As for python internals, https://snarky.ca/ has some great short high level “how does this construct work” text explainations.
KronisLV · 2022-09-12
Then I guess it's broken by default, considering that it was a pretty fresh install following whatever was the first Google result.
Regardless, someone actually advised against using PATH for pip because of confusion when you have multiple Python versions installed, which seemed like a sensible argument: https://snarky.ca/why-you-should-use-python-m-pip/
rednafi · 2022-03-30
I'd suggest following Bret Cannon's Syntactic Sugar series. It's an awesome overview of what goes behind different Python data structures.
https://snarky.ca/tag/syntactic-sugar/
brettcannon · 2020-04-01
People would love to see that happen, but it requires time and effort from people to build such a solution. Some people are trying, e.g. https://pyoxidizer.readthedocs.io/ and https://briefcase.readthedocs.io/ as well as stalwarts like PyInstaller and such.
But as I said, it takes time and effort and there's only so much of that when it's being done by volunteers in their evenings and weekends.
And as an aside, I would suggest teaching them `python -m pip` over `pip3`: https://snarky.ca/why-you-should-use-python-m-pip/.
jonawesomegreen · 2019-02-20
Open source is hard. Being a maintainer is hard. I've seen a lot of good people burn themselves out trying to maintain / contribute to open source software.
I think this is a great blog post / talk (not mine) about the topic:
https://snarky.ca/setting-expectations-for-open-source-participation/
"Here's a bit of real talk for people: I think working in OSS has made me more bitter and short-temperated".
Best wishes to the maintainer, hopefully time gives some perspective on the problems in the community and perhaps some ways forward.
drcongo · 2018-01-24
Funnily enough, an hour or so ago I was trying to track down a Python blog I used to enjoy and went on a "This blog has moved merry-go-round...
http://sayspy.blogspot.co.uk/2013/07/moving-this-blog-to-medium.html
https://medium.com/coder-who-says-py/i-have-moved-over-to-svbtle-564d5…
https://nothingbutsnark.svbtle.com/moving-the-blog-to-silvrback
And eventually to https://snarky.ca
aleyan · 2017-02-09
They did. [1][2] According to Brett Cannon who made the decision it came down to three things: GitHub has a built in social network, GitLab has no killer feature over GitHub, and Guido the beloved BDFL prefers GitHub.
[1] https://snarky.ca/the-history-behind-the-decision-to-move-python-to-gi…
[2] https://news.ycombinator.com/item?id=13611387
kamyarg · 2017-01-30
I would like to also add Brett Cannon: https://snarky.ca
His blog is very informative.
uryga · 2019-11-10
the coroutines are run sequentially by an "event loop"/"coroutine runner" that wakes them up and lets them run for a bit when appropriate, kind of like an OS's scheduler (on a single core machine). if the runner is the OS, `await foo(..)` is kind of like a syscall, where the coroutine is suspended and control is handed back to the runner to do whatever is requested.
i guess the difference from normal threads (preemptive multitasking) is that you explicitly mark your "yield points" – places where your code gives control back to the runner – with `await` (cooperative multitasking). some believe that this makes async stuff easier to reason about, since in theory you can see the points where stuff might happen concurrently
honestly i'm out of my depth re: async IO, haven't used it all that much :/ but if you're comfortable with python and want to dig into the mechanism of async/await, i really recommend this article: https://snarky.ca/how-the-heck-does-async-await-work-in-python-3-5/
it's long, but i found it very helpful – it actually explains how it all works without handwaviness. at the end the author implements a toy "event loop" that can run a few timers concurrently, which really made it click for me!
fweimer · 2023-12-11
The general topic is covered in Brett Cannon's “Python is (mostly) made of syntactic sugar” series of posts, via translation of high-level semantics into a subset of Python. LWN has a high-level summary: https://lwn.net/Articles/942767/
The actual posts are here: https://snarky.ca/tag/syntactic-sugar/ (multiple pages!)
kamaraju · 2023-03-20
I came across this package from https://snarky.ca/how-virtual-environments-work/ → “Introducing microvenv” section → first paragraph . Unlike the python3 package, this will install pip, venv, idle etc.,
Waterluvian · 2022-11-16
Here’s a good overview of the details between the two: https://snarky.ca/why-print-became-a-function-in-python-3/
“Why don’t we just keep both?” probably has many answers. The overwhelming one for me is that if everyone’s doing the same thing two ways, then everyone has to learn all the esoterics about the print statement.
“Why don’t you just do it for me?” is a cardinal sin for a runtime. And already exists in migration tools.
julienpalard · 2022-09-12
It's a good habit which ensures pip runs with the same interpreter as your `python` command.
One example (but there's many): On Windows a `pip install --upgrade pip` can't work as the OS would lock the `pip` executable, while a `python -m pip install --upgrade pip` works as the OS would lock python instead.
I also encontered environments (CI runners, things like this) with `python` and pip installed, installed but no `pip` shortcut.
More: https://snarky.ca/why-you-should-use-python-m-pip/
santiagobasulto · 2021-06-19
Poetry is a mainstream package manager. Every company I know uses it.
And more importantly, the concepts it brings will eventually become Python standards (like pyproject.toml or the lock file): https://snarky.ca/what-the-heck-is-pyproject-toml/
mimimi31 · 2021-05-01
Here's a blog post [1] by a Python core developer, which is in a similar vein.
[1] https://snarky.ca/setting-expectations-for-open-source-participation
BerislavLopac · 2021-04-08
With PEP-518 being 5 years old it's still relatively new, and most tools have implemented the support for it relatively recently. The key introduction article was written exactly one year ago: https://snarky.ca/what-the-heck-is-pyproject-toml/
coldtea · 2020-08-23
That's an easy question to answer.
python -m pip is often advised over pip or /usr/bin/pip, because it uses the version of pip associated with that particular major+minor python install.
https://snarky.ca/why-you-should-use-python-m-pip/
epistasis · 2020-08-05
I 100% agree on this. But it's been pretty hilarious on how obstinate tool makers are about changing to Python's new pyproject.toml [1]
Python packaging is a bit of a mess already, so when I recently started a new small package I wanted to choose tooling that would not clutter, but a fair amount of tool makers were reluctant to allow code into their repo that would use the unified toml rather than a ton of separate file.
.config is probably a better solution than a single top level toml, IMHO, but far more important is doing something unified rather than continuing the pollution of the top-level namespace, which merely obscures the project structure.
[1] https://snarky.ca/what-the-heck-is-pyproject-toml/
teraku · 2020-05-04
I never have issues with my Python environments, and I use either requirements, venv or pipenv, depending on the project.
And I use it on Windows and Linux, server and desktop. You might be interested in: https://snarky.ca/what-the-heck-is-pyproject-toml/
Qub3d · 2020-04-20
My personal thoughts on the matter aside, here is an informative post from Brett Cannon on why the Python 2/3 split happened:
https://snarky.ca/why-python-3-exists/
cpach · 2019-05-06
jsmeaton · 2018-05-02
3.7 makes it easier to use dynamic imports. https://snarky.ca/lazy-importing-in-python-3-7/
Andrex · 2018-01-24
Even snarky.ca has moved, from Silvrback to Ghost!
https://snarky.ca/why-i-changed-my-blogging-platform-to-ghost-pro/
jaimebuelta · 2017-02-13
Background info about why this migration and considered alternatives
https://snarky.ca/the-history-behind-the-decision-to-move-python-to-gi…
di · 2017-02-12
More details on the decision:
https://snarky.ca/the-history-behind-the-decision-to-move-python-to-gi…
cx1000 · 2017-02-10
Sounds to me like you don't understand how git works. If GitHub shuts down, people will just use a different server to host their repository, such as gitlab.
The guy in charge of making the decision weighed the fact that it's closed source, and it still won.
> But to me, the development process is more important than worrying whether a cloud-based service publishes its source code... This is especially not a worry as GitHub is not a walled garden; its extensive SDK allows for downloading any and all data that goes into the platform.
In summary, his reasons were: github has become a social network of open source devs; gitlab has no killer features github doesn't; and Guido prefers github
https://snarky.ca/the-history-behind-the-decision-to-move-python-to-gi…
brachi · 2017-01-19
Directly from core devs:
https://snarky.ca/why-python-3-exists/
cremno · 2016-01-15
That blog post contains three paragraphs discussing that: http://www.snarky.ca/the-history-behind-the-decision-to-move-python-to…