Ned Batchelder
@nedbat.com
📤 4280
📥 172
📝 213
Python, Boston, mathy fun, juggling, autism parenting.
https://nedbat.com
I learned a few algorithms for generative art, you can too:
nedbatchelder.com/blog/202509/...
loading . . .
Hobby Hilbert Simplex
An exploration and explanation of how to generate interesting swoopy art
https://nedbatchelder.com/blog/202509/hobby_hilbert_simplex.html
1 day ago
0
7
1
People should spend less time learning DSA, more time learning testing.
nedbatchelder.com/blog/202509/...
loading . . .
Testing is better than DSA
People should spend less time learning DSA, more time learning testing.
https://nedbatchelder.com/blog/202509/testing_is_better_than_dsa.html
5 days ago
1
8
4
Vote Forward is running letter-writing campaigns to US voters.
votefwd.org
Does it help? Not sure. Doom-scrolling doesn't!
loading . . .
Vote Forward
Vote Forward volunteers send heartfelt handwritten letters to unregistered and low-propensity voters encouraging them to participate in our democracy. The letters have been shown to significantly boos...
https://votefwd.org/
9 days ago
0
0
0
My wife's latest for Psychology Today. That's me in the pic, about 22 years ago..
www.psychologytoday.com/us/blog/all-...
loading . . .
A Lifetime of Autism and Summer Vacations
Personal Perspective: As empty-nesters, we can go anywhere, do anything. But in the summer, we don't. We go to that same rental, even though it is way too big for just the two of us.
https://www.psychologytoday.com/us/blog/all-families-are-not-alike/202508/a-lifetime-of-autism-and-summer-vacations
about 1 month ago
0
6
1
Thanks to an amazing contribution by Alex Gaynor, `coverage combine` is now twice as fast! Not released yet, but give it a try and report back. python3 -m pip install git+https://github.com/nedbat/coveragepy
about 1 month ago
0
10
1
reposted by
Ned Batchelder
Mike Fiedler
about 2 months ago
Love it! And stacking parametrize for combinations is cool, too!
0
7
1
The pytest.mark.parametrize feature is amazing, and more people should use it, especially people new to writing
#Python
tests. But it looks scary. I wrote an explainer:
nedbatchelder.com/blog/202508/...
loading . . .
Starting with pytest’s parametrize
Pytest’s parametrize feature is powerful but it looks scary. I hope this step-by-step explanation helps people use it more.
https://nedbatchelder.com/blog/202508/starting_with_pytests_parametrize.html
about 2 months ago
1
15
3
I fixed a handful of issues with the new `patch = subprocess` feature in coverage․py. Try 7.10.3 and let me know how it goes!
coverage.readthedocs.io/en/7.10.3/ch...
loading . . .
Change history for coverage.py — Coverage.py 7.10.3 documentation
https://coverage.readthedocs.io/en/7.10.3/changes.html#version-7-10-3-2025-08-10
about 2 months ago
0
6
0
Every puzzle contains another puzzle: how was it constructed? The game Flow Free asks you to find the paths to connect same-colored dots on a grid. How are these layouts created?
about 2 months ago
2
6
1
You are a treasure, and I hope you have someone who treasures you.
about 2 months ago
2
27
5
"Coverage is one of those tools that's just silently awesome."
news.ycombinator.com/item?id=4472...
loading . . .
Coverage.py Regex Pragmas | Hacker News
https://news.ycombinator.com/item?id=44723131
2 months ago
0
12
0
Did you know you can write your own regexes to exclude code from
coverage.py
measurement?
nedbatchelder.com/blog/202507/...
loading . . .
https://coverage.py
2 months ago
1
4
3
A few more words about the new `patch` option in coverage․py 7.10: "The latest release of Coverage feels like a Christmas present!"
nedbatchelder.com/blog/202507/...
loading . . .
Coverage 7.10.0: patch
Coverage 7.10 has some significant new features that have solved some long-standing problems.
https://nedbatchelder.com/blog/202507/coverage_7100_patch.html
2 months ago
0
5
0
reposted by
Ned Batchelder
2 months ago
@nedbat.com
The latest release of Coverage feels like a Christmas present! The native support for Python subprocesses is so good! Thank you for all of it 🙏🏻
1
4
2
In
#Python
, why is `reversed(range(...))` different than `range(...)`?
nedbatchelder.com/blog/202507/...
loading . . .
2048: iterators and iterables
Making a simple game, I waded into a classic iterator/iterable confusion.
https://nedbatchelder.com/blog/202507/2048_iterators_and_iterables.html
2 months ago
0
7
0
What's the best way these days to get nightly builds of
#Python
versions? I have deadsnakes in the coverage․py nightly action, but some of the builds are over two weeks old and I don't know why. Would pyenv be better? uv? Anyone have an example working well for me to copy^H^H^H^H be inspired by?
3 months ago
0
1
0
reposted by
Ned Batchelder
Chad Whitacre
3 months ago
For Open Path â„– 2, I talked to
@simonwillison.net
,
@nedbat.com
, and five other maintainers to understand the Open Source burnout crisis from their point of view. The dream? Financial support w/o hoops! Full episode:
www.youtube.com/watch?v=VTY-...
loading . . .
0
10
4
Are you in Boston and want to hang with
#Python
people? Boston Python's project & collaboration night is June 24th. It's an informal gathering to talk together, work together, learn from each other, network, whatever. Tell your friends :)
www.meetup.com/bostonpython...
loading . . .
Project & Collaboration Night, Tue, Jun 24, 2025, 6:00 PM | Meetup
Bring a laptop. Bring ideas. Bring questions. Bring enthusiasm. Bring friends. The Boston Python Project & Collaboration Night is a time to find others with compatible inte
https://www.meetup.com/bostonpython/events/308465972/
3 months ago
0
9
5
Two geometric facts about 63, but how to connect them?
nedbatchelder.com/blog/202506/...
loading . . .
Math factoid of the day: 63
Two geometric facts about 63, but how to connect them?
https://nedbatchelder.com/blog/202506/math_factoid_of_the_day_63.html
3 months ago
2
9
3
Cog 3.5! --check now has --diff to see what changed shorter checksum format to be less distracting current directory restoration to simplify your code and, shocker! --help works!
cog.readthedocs.io
loading . . .
Cog — cog 3.5.1 documentation
https://cog.readthedocs.io/
4 months ago
0
3
0
39 years ago today....
nedbatchelder.com/blog/202506/...
loading . . .
Digital Equipment Corporation no more
Tech giants come and go
https://nedbatchelder.com/blog/202506/digital_equipment_corporation_no_more.html
4 months ago
0
19
2
Every June I dig this up:
hachyderm.io/@nedbat/1105...
loading . . .
Ned Batchelder (@
[email protected]
)
Attached: 1 image Do you have interns at work this summer? They may find this helpful (created by a summer intern at edX a few years ago):
https://hachyderm.io/@nedbat/110549139925182481
4 months ago
0
18
4
reposted by
Ned Batchelder
cait (and adonis)
4 months ago
a friend of mine shared this ai-generated "emotion wheel" and unfortunately i have been laughing my ass off at it for like 15 minutes now. today i am feeling Fnliinneon
244
5178
2628
Good news: the site is back, though I still have questions about what happened...
add a skeleton here at some point
4 months ago
0
2
0
Well, I *used* to have a web site! Digital Ocean "upgraded" my server three days ago, and
nedbatchelder.com
hasn't worked since. They say they are working on it...
loading . . .
https://nedbatchelder.com
4 months ago
0
4
1
Hmm, in CI, the "tests" action works, but the "coverage" action fails, and nothing has changed. Debugging it, I'm going to learn something. >> I learn something new every day, no matter how hard I try.
4 months ago
0
7
0
Intriguing:
css-doodle.com
loading . . .
<css-doodle />
A web component for drawing patterns with CSS
https://css-doodle.com/
4 months ago
0
3
0
There's an odd resonance when your project's issue numbers start being years that you've lived through:
github.com/nedbat/cover...
loading . . .
Prevent module reinitialisation with multi-phase init by AA-Turner · Pull Request #1978 · nedbat/coveragepy
cc @nedbat xref: 80e977c Use multi-phase initialisation (PEP 489)Â #1977 Changes written by a human ;-) The ctracer module still uses static types (e.g. CTracerType), so is not isolated and may ha...
https://github.com/nedbat/coveragepy/pull/1978
4 months ago
0
6
0
As a tool author, it's hard to keep up with all the changes to keep my code up-to-date. Sometimes a polite reminder is all it takes:
github.com/nedbat/cover...
Also, Claude made the code changes, and did a good job!
loading . . .
Use multi-phase initialisation (PEP 489) · Issue #1977 · nedbat/coveragepy
Hello, Please consider adopting multi-phase init for your Python extension modules. In short, multi-phase makes extension modules behave more like pure-Python modules and means that the import syst...
https://github.com/nedbat/coveragepy/issues/1977
4 months ago
1
3
0
How desperate is my current "machete mode" debugging? I put "except: pass" on one line instead of two!
nedbatchelder.com/text/machete...
loading . . .
Machete-mode Debugging
How to debug thorny Python problems, using Python’s dynamic nature to extract information in unusual ways.
https://nedbatchelder.com/text/machete.html
4 months ago
1
9
0
Want more play at
#PyConUS
? Join us at the juggling open-space at 3:45 Saturday outside the 3rd floor rooms. It's not sky-diving, but it's still great! We'll teach you!
4 months ago
0
6
0
My suggestion related to this morning's
#PyConUS
diversity panel: A simple way to help with inclusion is to sit at lunch with someone who doesn't seem like you, and introduce yourself. It's easy, it's free, and those small connections grow and welcome people in.
4 months ago
1
32
3
reposted by
Ned Batchelder
Trey Hunner
5 months ago
đź’Ż this. I also describe PyCon as "like summer camp". Something that also fits into this analogy is the post-camp blues. Coming down off the excitement of PyCon summer camp can feel mildly depressing the week after.
@kojoidrissa.bsky.social
has written about this:
kojoidrissa.com/conferences/...
loading . . .
A Beginner’s Guide to Post Conference Depression
One thing I noticed at PyCon Africa was this seemed to be the first tech conference for a lot of the people I spoke to. As such, I realized folks may not be ready for the VERY real “post-conference de...
https://kojoidrissa.com/conferences/community/pycon%20africa/noramgt/2019/08/11/post_conference_depression.html
0
9
3
Headed to
#PyConUS
, thinking about how to approach the excitement.
nedbatchelder.com/blog/202505/...
loading . . .
PyCon summer camp
PyCon is exciting, but how do you know which enthusiasms are real and which are just summer crushes?
https://nedbatchelder.com/blog/202505/pycon_summer_camp.html
5 months ago
1
11
3
reposted by
Ned Batchelder
Vic Iglesias
5 months ago
You may prefer the analysis from
@redmonk.com
redmonk.com/sogrady/2024...
Looking forward to the next one being published.
loading . . .
The RedMonk Programming Language Rankings: June 2024
This iteration of the RedMonk programming Language Rankings is brought to you by Amazon Web Services. AWS manages a variety of developer communities where you can join and learn more about building mo...
https://redmonk.com/sogrady/2024/09/12/language-rankings-6-24/
0
1
1
The TIOBE index is crude, but it's exciting to see
#Python
continuing to shine:
www.tiobe.com/tiobe-index/
Too bad about the simplistic and misleading summary: "[Python] is interpreted and thus prone to unexpected run-time errors."
loading . . .
TIOBE Index - TIOBE
https://www.tiobe.com/tiobe-index/
5 months ago
1
4
0
Anyone going to
#PyConUS
and can bring some juggling props? I'll bring some, not sure about clubs.
5 months ago
0
5
2
You can tell TOML is a backronym because the O definitely doesn't stand for Obvious:
toml.io/en/v1.0.0#ar...
loading . . .
TOML: English v1.0.0
https://toml.io/en/v1.0.0#array-of-tables
5 months ago
1
5
0
In which our hero fine-tunes when GitHub actions are run, and battles mysterious YAML and GitHub oddities along the way:
nedbatchelder.com/blog/202505/...
loading . . .
Filtering GitHub actions by changed files
How to limit what GitHub workflows run based on what files have changed.
https://nedbatchelder.com/blog/202505/filtering_github_actions_by_changed_files.html
5 months ago
1
5
1
A downside of uv (or any other tool) doing so many different things: it's hard to search for "getting started with uv" because you find people using it for a different task than you wanted it for.
5 months ago
2
9
0
Another kind of bug revealed by including tests in your coverage: with pytest.raises(ValueError): process_data("bad data 1") process_data("bad data 2") # never executed!
nedbatchelder.com/blog/202008/...
loading . . .
You should include your tests in coverage
This seems to be a recurring debate: should you measure the coverage of your tests? In my opinion, definitely yes.
https://nedbatchelder.com/blog/202008/you_should_include_your_tests_in_coverage.html
5 months ago
1
9
1
If an error in your
#Python
program seems impossible, double-check that you haven't edited the source after starting the program. Tracebacks re-read the source files to show the lines of code, so they can show you edited lines that aren't what you are running.
5 months ago
1
23
5
Sad to see an AI suggest these entries for a [tool.coverage.run] section: omit = tests/*, */__init__.py, */__main__.py, */cli.py, */setup.py, */__pycache__/*, */test_*.py
nedbatchelder.com/blog/202008/...
loading . . .
You should include your tests in coverage
This seems to be a recurring debate: should you measure the coverage of your tests? In my opinion, definitely yes.
https://nedbatchelder.com/blog/202008/you_should_include_your_tests_in_coverage.html
5 months ago
1
10
3
Q: What's the plural of regex? A: regex{2,}
5 months ago
3
43
4
I'm proud of Boston! Resistance with flair:
silencedogoodboston.com
loading . . .
Home — Silence Dogood
https://silencedogoodboston.com
5 months ago
0
3
0
Some little-used
#Python
regular expression features that *aren't* confusing punctuation!
nedbatchelder.com/blog/202504/...
loading . . .
Regex affordances
A tour of some real code showing little-used power features of the Python regular expression module.
https://nedbatchelder.com/blog/202504/regex_affordances.html
5 months ago
0
7
1
Among the many oddities in YAML is the variety of string formatting options. Here's a site that explains them:
yaml-multiline.info
loading . . .
YAML Multiline Strings
Find the right syntax for your YAML multiline strings.
https://yaml-multiline.info/
5 months ago
1
7
3
A parenting story from 30 years ago. Connecting with a six-year-old doesn't go as planned.
nedbatchelder.com/blog/202504/...
loading . . .
Find the bear
Connecting with my six-year-old doesn’t go as planned.
https://nedbatchelder.com/blog/202504/find_the_bear.html
6 months ago
1
6
0
Want a concise daily digest of issue and pull request activity from your GitHub repos? Try Dinghy:
pypi.org/project/ding...
6 months ago
0
10
2
Sorting strings in
#Python
the way people expect:
nedbatchelder.com/blog/202503/...
loading . . .
Human sorting improved
When sorting strings, you’d often like the order to make sense to a person. That means numbers need to be treated numerically even if they are in a larger string.
https://nedbatchelder.com/blog/202503/human_sorting_improved.html
6 months ago
1
12
0
Load more
feeds!
log in