Ned Batchelder's Avatar

Ned Batchelder

@nedbat.com

Python, Boston, mathy fun, juggling, autism parenting. https://nedbat.com

4,349
Followers
172
Following
229
Posts
30.06.2023
Joined
Posts Following

Latest posts by Ned Batchelder @nedbat.com

Have you tried the Microsoft NERD center?

10.02.2026 19:27 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
EdText edtext is a utility inspired by the ed editor for selecting and manipulating lines of text.

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/...

09.02.2026 12:58 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

We can agree to disagree :)

17.01.2026 17:06 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
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

This Wednesday! #Boston #Python
www.meetup.com/bostonpython...

17.01.2026 16:29 πŸ‘ 3 πŸ” 1 πŸ’¬ 1 πŸ“Œ 0
Preview
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,

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!

14.01.2026 15:15 πŸ‘ 4 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Post image

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

30.12.2025 15:29 πŸ‘ 4 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
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.

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/...

21.12.2025 16:57 πŸ‘ 5 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
A testing conundrum A useful class that is hard to test thoroughly, and my failed attempt to use Hypothesis to do it.

A useful class that is hard to test thoroughly, and my failed attempt to use Hypothesis to do it: nedbatchelder.com/blog/202512/...

18.12.2025 16:42 πŸ‘ 6 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

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...

11.12.2025 13:54 πŸ‘ 8 πŸ” 2 πŸ’¬ 0 πŸ“Œ 0

Did you get more from him about why that seemed absurd to him?

20.11.2025 13:28 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Preview
Sponsor the PSF The official home of the Python Programming Language

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...

18.11.2025 23:59 πŸ‘ 33 πŸ” 20 πŸ’¬ 1 πŸ“Œ 2
Preview
Autism Adulthood, 3rd edition My wife’s book is out today, you should buy it.

"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/...

18.11.2025 14:11 πŸ‘ 5 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Python Software Foundation Sponsors The official home of the Python Programming Language

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/

05.11.2025 18:49 πŸ‘ 46 πŸ” 20 πŸ’¬ 0 πŸ“Œ 0
Side project advice A chat about side projects from a Boston Python project night: choose your paths and forgive yourself.

Boston Python is a good place to connect with people and even have have non-technical discussions:
nedbatchelder.com/blog/202510/...

30.10.2025 12:21 πŸ‘ 8 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
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.

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...

29.10.2025 12:08 πŸ‘ 8 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
The official home of the Python Programming Language

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-...
🧡

27.10.2025 14:47 πŸ‘ 6416 πŸ” 2756 πŸ’¬ 125 πŸ“Œ 452
A stack of stamped envelopes, ready for mailing

A stack of stamped envelopes, ready for mailing

I'm writing letters to defend democracy, how are you spending your day? votefwd.org

25.10.2025 17:13 πŸ‘ 12 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Preview
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...

If you can go out to a march, you can spend an hour writing letters to encourage voters. votefwd.org

22.10.2025 10:14 πŸ‘ 4 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
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...

Vote Forward is running letter-writing campaigns to US voters. votefwd.org
Does it help? Not sure. Doom-scrolling doesn't!

14.10.2025 15:53 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Hobby Hilbert Simplex An exploration and explanation of how to generate interesting swoopy art

I learned a few algorithms for generative art, you can too:
nedbatchelder.com/blog/202509/...

26.09.2025 12:19 πŸ‘ 8 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Testing is better than DSA People should spend less time learning DSA, more time learning testing.

People should spend less time learning DSA, more time learning testing.

nedbatchelder.com/blog/202509/...

22.09.2025 16:13 πŸ‘ 8 πŸ” 4 πŸ’¬ 1 πŸ“Œ 0
Preview
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...

Vote Forward is running letter-writing campaigns to US voters. votefwd.org
Does it help? Not sure. Doom-scrolling doesn't!

19.09.2025 12:07 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
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.

My wife's latest for Psychology Today. That's me in the pic, about 22 years ago..

www.psychologytoday.com/us/blog/all-...

25.08.2025 14:23 πŸ‘ 6 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

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

19.08.2025 14:07 πŸ‘ 10 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

Love it! And stacking parametrize for combinations is cool, too!

13.08.2025 12:12 πŸ‘ 7 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
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.

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/...

13.08.2025 11:09 πŸ‘ 16 πŸ” 3 πŸ’¬ 1 πŸ“Œ 0
Change history for coverage.py β€” Coverage.py 7.10.3 documentation

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...

11.08.2025 13:16 πŸ‘ 6 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
A hexagonal grid with tightly-packed paths connecting same-colored dots.

A hexagonal grid with tightly-packed paths connecting same-colored dots.

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?

07.08.2025 17:08 πŸ‘ 6 πŸ” 1 πŸ’¬ 2 πŸ“Œ 0

You are a treasure, and I hope you have someone who treasures you.

31.07.2025 14:03 πŸ‘ 26 πŸ” 5 πŸ’¬ 2 πŸ“Œ 0
Coverage.py Regex Pragmas | Hacker News

"Coverage is one of those tools that's just silently awesome."

news.ycombinator.com/item?id=4472...

29.07.2025 17:51 πŸ‘ 12 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0