Sign in

Ned Batchelder

@nedbat.com
4.4K followers 171 following 232 posts

Python, Boston, mathy fun, juggling, autism parenting. nedbat.com

PostsRepliesMedia
Ned Batchelder @nedbat.com · 27/09/2026
Here's a simple way to help U.S. political candidates: Oath analyzes races, crunches the data to find where money will do the most good, and distributes funds. Choose your cause, and direct money to where it has the best chance to make a difference. app.oath.vote
011
Ned Batchelder @nedbat.com · 02/05/2026
Write letters to new voters! The more people are involved, the better everyone will be heard. votefwd.org
votefwd.org
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...
041
Reposted by Ned Batchelder
Python Software Foundation @python.org · 14/04/2026
Are you going to #PyConUS? Have you booked in our hotel block? New on the blog, some hard numbers & why we’re in a tight spot. We only have until April 24th to turn the tide, so please read, share, and book your PyCon US stay in the official block today.
pyfound.blogspot.com
Python Software Foundation News
32224
Ned Batchelder @nedbat.com · 09/02/2026
I got tired of hacking ad-hoc text selection functions, so I wrote edtext: line selection and manipulation using ed address ranges. nedbatchelder.com/blog/202602/...
nedbatchelder.com
EdText
edtext is a utility inspired by the ed editor for selecting and manipulating lines of text.
020
Ned Batchelder @nedbat.com · 17/01/2026
This Wednesday! #Boston #Python www.meetup.com/bostonpython...
meetup.com
Responsible Pytest Usage, Wed, Jan 21, 2026, 6:00 PM | Meetup
A presentation sponsored by Matterbeam David Sturgis: Responsible Pytest Usage PyTest is an increasingly popular framework for automated software testing in Python. In so
141
Ned Batchelder @nedbat.com · 14/01/2026
Boston Python presentation night in one week: Responsible Pytest Usage by David Sturgis, sponsored by Matterbeam. www.meetup.com/bostonpython... Join us if you are in the area!
meetup.com
Responsible Pytest Usage, Wed, Jan 21, 2026, 6:00 PM | Meetup
A presentation sponsored by Matterbeam David Sturgis: Responsible Pytest Usage PyTest is an increasingly popular framework for automated testing in Python. In some ways,
041
Reposted by Ned Batchelder
Brady @DataCastworks @datacastworks.bsky.social · 30/12/2025
Needed to clean code after my first major rewrite. 'Coverage.py' is awesome, showed exactly what isn't getting called. I silently broke something on the path to email alerts for the error logger. Oops... @nedbat.com #python #coding
051
Ned Batchelder @nedbat.com · 21/12/2025
In which the author dives very deep (far deeper than called for) into using Hypothesis to generate data for #Python tests: nedbatchelder.com/blog/202512/...
nedbatchelder.com
Generating data shapes with Hypothesis
I used Hypothesis to generate random data structure schemas, and then generate random data using them. I learned a lot along the way.
070
Ned Batchelder @nedbat.com · 18/12/2025
A useful class that is hard to test thoroughly, and my failed attempt to use Hypothesis to do it: nedbatchelder.com/blog/202512/...
nedbatchelder.com
A testing conundrum
A useful class that is hard to test thoroughly, and my failed attempt to use Hypothesis to do it.
070
Reposted by Ned Batchelder
Rodrigo Girão Serrão 🐍🚀 @mathspp.com · 11/12/2025
I learned this 1+ year ago from @nedbat.com and had to use it yesterday with the code shown above. I was so annoyed by my code on the left and SUDDENLY I remembered Ned's trick and voilà, my code became so much nicer...
092
Ned Batchelder @nedbat.com · 18/11/2025
How much is your company spending to support the Python Software Foundation? For comparison, how much do they spend for tips on expensed meals? The PSF runs PyPI, where pip installs from. You depend on PyPI. Fund the PSF. Tip your server! www.python.org/psf/sponsors...
python.org
Sponsor the PSF
The official home of the Python Programming Language
13320
Ned Batchelder @nedbat.com · 18/11/2025
"If you have someone in your life on the spectrum, or are on it yourself, I guarantee you will find new ways to understand the breadth of what autism means and what it can be." nedbatchelder.com/blog/202511/...
nedbatchelder.com
Autism Adulthood, 3rd edition
My wife’s book is out today, you should buy it.
050
Ned Batchelder @nedbat.com · 05/11/2025
Forget about supporting the PSF, too abstract. Pip installs from PyPI. It would be bad if `pip install` stopped working. Support the org that runs PyPI. Surprise, it's the PSF! Your company depends on #Python. You want it to keep working and keep being good. python.org/psf/sponsors/
python.org
Python Software Foundation Sponsors
The official home of the Python Programming Language
04520
Ned Batchelder @nedbat.com · 30/10/2025
Boston Python is a good place to connect with people and even have have non-technical discussions: nedbatchelder.com/blog/202510/...
nedbatchelder.com
Side project advice
A chat about side projects from a Boston Python project night: choose your paths and forgive yourself.
071
Ned Batchelder @nedbat.com · 29/10/2025
Nice! My coverage dropped from 94.370% to 94.366%! (I deleted code that had been covered, but was no longer needed) github.com/nedbat/cover... github.com/nedbat/cover...
github.com
test: no longer need to support multiple 'lines' · nedbat/coveragepy@f8f3edc
Since 3.10 is our minimum, and it conforms to PEP 626, we know what lines will be reported, and don't need multiple options.
080
Reposted by Ned Batchelder
Python Software Foundation @python.org · 27/10/2025
TLDR; The PSF has made the decision to put our community and our shared diversity, equity, and inclusion values ahead of seeking $1.5M in new revenue. Please read and share. pyfound.blogspot.com/2025/10/NSF-... 🧵
python.org
The official home of the Python Programming Language
12363792728
Ned Batchelder @nedbat.com · 25/10/2025
I'm writing letters to defend democracy, how are you spending your day? votefwd.org
A stack of stamped envelopes, ready for mailing
1120
Ned Batchelder @nedbat.com · 22/10/2025
If you can go out to a march, you can spend an hour writing letters to encourage voters. votefwd.org
votefwd.org
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...
041
Ned Batchelder @nedbat.com · 14/10/2025
Vote Forward is running letter-writing campaigns to US voters. votefwd.org Does it help? Not sure. Doom-scrolling doesn't!
votefwd.org
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...
020
Ned Batchelder @nedbat.com · 26/09/2025
I learned a few algorithms for generative art, you can too: nedbatchelder.com/blog/202509/...
nedbatchelder.com
Hobby Hilbert Simplex
An exploration and explanation of how to generate interesting swoopy art
081
Ned Batchelder @nedbat.com · 22/09/2025
People should spend less time learning DSA, more time learning testing. nedbatchelder.com/blog/202509/...
nedbatchelder.com
Testing is better than DSA
People should spend less time learning DSA, more time learning testing.
194
Ned Batchelder @nedbat.com · 19/09/2025
Vote Forward is running letter-writing campaigns to US voters. votefwd.org Does it help? Not sure. Doom-scrolling doesn't!
votefwd.org
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...
000
Ned Batchelder @nedbat.com · 25/08/2025
My wife's latest for Psychology Today. That's me in the pic, about 22 years ago.. www.psychologytoday.com/us/blog/all-...
psychologytoday.com
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.
061
Ned Batchelder @nedbat.com · 19/08/2025
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
0101
Reposted by Ned Batchelder
Mike Fiedler @miketheman.com · 13/08/2025
Love it! And stacking parametrize for combinations is cool, too!
071
Ned Batchelder @nedbat.com · 13/08/2025
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/...
nedbatchelder.com
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.
1163
Ned Batchelder @nedbat.com · 11/08/2025
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...
coverage.readthedocs.io
Change history for coverage.py — Coverage.py 7.10.3 documentation
060
Ned Batchelder @nedbat.com · 07/08/2025
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?
A hexagonal grid with tightly-packed paths connecting same-colored dots.
261
Ned Batchelder @nedbat.com · 31/07/2025
You are a treasure, and I hope you have someone who treasures you.
2265
Ned Batchelder @nedbat.com · 29/07/2025
"Coverage is one of those tools that's just silently awesome." news.ycombinator.com/item?id=4472...
news.ycombinator.com
Coverage.py Regex Pragmas | Hacker News
0110
Ned Batchelder @nedbat.com · 29/07/2025
Did you know you can write your own regexes to exclude code from coverage.py measurement? nedbatchelder.com/blog/202507/...
coverage.py
143
Ned Batchelder @nedbat.com · 25/07/2025
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/...
nedbatchelder.com
Coverage 7.10.0: patch
Coverage 7.10 has some significant new features that have solved some long-standing problems.
050
Reposted by Ned Batchelder
leodevian.bsky.social @leodevian.bsky.social · 24/07/2025
@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 🙏🏻
142
Ned Batchelder @nedbat.com · 15/07/2025
In #Python, why is `reversed(range(...))` different than `range(...)`? nedbatchelder.com/blog/202507/...
nedbatchelder.com
2048: iterators and iterables
Making a simple game, I waded into a classic iterator/iterable confusion.
070
Ned Batchelder @nedbat.com · 30/06/2025
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?
010
Ned Batchelder @nedbat.com · 17/06/2025
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...
meetup.com
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
095
Ned Batchelder @nedbat.com · 16/06/2025
Two geometric facts about 63, but how to connect them? nedbatchelder.com/blog/202506/...
nedbatchelder.com
Math factoid of the day: 63
Two geometric facts about 63, but how to connect them?
293
Ned Batchelder @nedbat.com · 10/06/2025
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
cog.readthedocs.io
Cog — cog 3.5.1 documentation
030
Ned Batchelder @nedbat.com · 09/06/2025
39 years ago today.... nedbatchelder.com/blog/202506/...
nedbatchelder.com
Digital Equipment Corporation no more
Tech giants come and go
0192
Ned Batchelder @nedbat.com · 06/06/2025
Every June I dig this up: hachyderm.io/@nedbat/1105...
hachyderm.io
Ned Batchelder (@nedbat@hachyderm.io)
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):
0184
Reposted by Ned Batchelder
cait (and adonis) @cait.bsky.social · 05/06/2025
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
emotion wheel starting with "joy, fear, anger" in the center and then lapsing into gibberish
23951501321
Ned Batchelder @nedbat.com · 05/06/2025
Good news: the site is back, though I still have questions about what happened...
020
Ned Batchelder @nedbat.com · 05/06/2025
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...
nedbatchelder.com
040
Ned Batchelder @nedbat.com · 31/05/2025
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.
070
Ned Batchelder @nedbat.com · 30/05/2025
Intriguing: css-doodle.com
css-doodle.com
<css-doodle />
A web component for drawing patterns with CSS
030
Ned Batchelder @nedbat.com · 28/05/2025
There's an odd resonance when your project's issue numbers start being years that you've lived through: github.com/nedbat/cover...
github.com
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...
060
Ned Batchelder @nedbat.com · 28/05/2025
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!
github.com
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...
130
Ned Batchelder @nedbat.com · 20/05/2025
How desperate is my current "machete mode" debugging? I put "except: pass" on one line instead of two! nedbatchelder.com/text/machete...
nedbatchelder.com
Machete-mode Debugging
How to debug thorny Python problems, using Python’s dynamic nature to extract information in unusual ways.
190
Ned Batchelder @nedbat.com · 17/05/2025
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!
060