Ned Batchelder
@nedbat.com
đ€ 4321
đ„ 172
đ 224
Python, Boston, mathy fun, juggling, autism parenting.
https://nedbat.com
reposted by
Ned Batchelder
Data Castworks
11 days ago
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
0
4
1
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/...
loading . . .
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.
https://nedbatchelder.com/blog/202512/generating_data_shapes_with_hypothesis.html
19 days ago
0
5
0
A useful class that is hard to test thoroughly, and my failed attempt to use Hypothesis to do it:
nedbatchelder.com/blog/202512/...
loading . . .
A testing conundrum
A useful class that is hard to test thoroughly, and my failed attempt to use Hypothesis to do it.
https://nedbatchelder.com/blog/202512/a_testing_conundrum.html
22 days ago
0
6
0
reposted by
Ned Batchelder
Rodrigo GirĂŁo SerrĂŁo đđ
30 days ago
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...
0
8
2
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...
loading . . .
Sponsor the PSF
The official home of the Python Programming Language
https://www.python.org/psf/sponsorship/
about 2 months ago
1
32
21
"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/...
loading . . .
Autism Adulthood, 3rd edition
My wifeâs book is out today, you should buy it.
https://nedbatchelder.com/blog/202511/autism_adulthood_3rd_edition.html
about 2 months ago
0
5
0
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/
loading . . .
Python Software Foundation Sponsors
The official home of the Python Programming Language
https://python.org/psf/sponsors/
2 months ago
0
46
21
Boston Python is a good place to connect with people and even have have non-technical discussions:
nedbatchelder.com/blog/202510/...
loading . . .
Side project advice
A chat about side projects from a Boston Python project night: choose your paths and forgive yourself.
https://nedbatchelder.com/blog/202510/side_project_advice.html
2 months ago
0
7
1
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...
loading . . .
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.
https://github.com/nedbat/coveragepy/commit/f8f3edc02eb12465508e96b057148ed24a9d0ffe
2 months ago
0
9
0
reposted by
Ned Batchelder
Python Software Foundation
2 months ago
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-...
đ§”
loading . . .
The official home of the Python Programming Language
https://www.python.org/sponsors/application/
127
6436
3223
I'm writing letters to defend democracy, how are you spending your day?
votefwd.org
3 months ago
1
12
0
If you can go out to a march, you can spend an hour writing letters to encourage voters.
votefwd.org
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
3 months ago
0
4
1
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
3 months ago
0
2
0
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
4 months ago
0
8
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
4 months 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/
4 months 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
5 months 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
5 months ago
0
10
1
reposted by
Ned Batchelder
Mike Fiedler
5 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
5 months ago
1
16
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
5 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?
5 months ago
2
6
1
You are a treasure, and I hope you have someone who treasures you.
5 months ago
2
26
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
5 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
6 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
6 months ago
0
5
0
reposted by
Ned Batchelder
6 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
6 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?
6 months ago
0
1
0
reposted by
Ned Batchelder
Chad Whitacre
7 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/
7 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
7 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/
7 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
7 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
7 months ago
0
18
4
reposted by
Ned Batchelder
cait (and adonis)
7 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
241
5174
2623
Good news: the site is back, though I still have questions about what happened...
add a skeleton here at some point
7 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
7 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.
7 months ago
0
7
0
Intriguing:
css-doodle.com
loading . . .
<css-doodle />
A web component for drawing patterns with CSS
https://css-doodle.com/
8 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
8 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
8 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
8 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!
8 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.
8 months ago
1
32
3
reposted by
Ned Batchelder
Trey Hunner
8 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
8 months ago
1
11
3
reposted by
Ned Batchelder
Vic Iglesias
8 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/
8 months ago
1
4
0
Anyone going to
#PyConUS
and can bring some juggling props? I'll bring some, not sure about clubs.
8 months ago
0
5
2
Load more
feeds!
log in