Ned Batchelder's blog

Ned Batchelder's personal blog.
https://nedbatchelder.com/blog (RSS)
visit blog
Me on On the Board
10 Nov 2024 | original ↗

I was on episode 4 of the On The Board podcast: Taking on New Challenges. I’m never quite sure what parts of my experience people will be able to relate to, but it was a good chat with Jason and Michael about becoming a newb late in my career.

Coverage.py originally
2 Nov 2024 | original ↗

Something many people don’t realize is that I didn’t write the original coverage.py. It was written by Gareth Rees in 2001. I’ve been extending and maintaining it since 2004. This ancient history came up this week, so I grabbed the 2001 version from archive.org to keep it here for posterity.I already had a copy of Gareth’s original page about...

GitHub action security: zizmor
30 Oct 2024 | original ↗

Zizmor is a new tool to check your GitHub action workflows for security concerns. I found it really helpful to lock down actions.Action workflows can be esoteric, and continuous integration is not everyone’s top concern, so it’s easy for them to have subtle flaws. A tool like zizmor is great for drawing attention to them.When I ran it, I had a...

Git aliases: switch to mainster, etc
26 Oct 2024 | original ↗

I use a lot of git aliases because I work in the terminal and aliases give me short commands for common operations. They are defined in my global git config file and range from simple to powerful but twisty.First, some basic aliases for operations I do often:[alias] br = branch co = checkout sw = switch d = diff di = diff...

Changelog automation
29 Sept 2024 | original ↗

I have two main approaches for producing changelogs, but both are based on the same principles: make it convenient for the author to create them, then make it possible to use the information automatically to benefit the readers.The first way is with a tool such as scriv, which I wrote, but which was inspired by previous similar tools like...

Changelog philosophy
28 Sept 2024 | original ↗

I playfully quipped about changelogs, and Sumana Harihareswara thoughtfully responded with Changelogs and Release Notes. I agree with her on some things, and disagree on others.My point with the meme was that people should put effort into a hand-crafted description of what has changed in each release of their product. It should be focused on...

Cleaning up a messy branch
21 Sept 2024 | original ↗

Let’s say you have a long-lived git branch. Most of the changes should be merged back to main, but some of the changes were already cherry-picked from main, and some of the changes shouldn’t be put onto main at all. How do you review the branch and merge it?Here’s a diagram of a simple example. The main branch at the top has seven commits. ...

Cogged GitHub profile
14 Sept 2024 | original ↗

Cog is my tool for using bits of Python to generate content inside an otherwise static file. I used it in extreme ways to generate my GitHub profile page.If you haven’t seen it before, you can customize your GitHub profile by creating a README.md in a repo named the same as your username. So my profile is rendered from...

Coverage branches instead of arcs
26 Aug 2024 | original ↗

As I mentioned in a few recent posts, I’ve been working on some significant work in coverage.py to take advantage of new capabilities in Python.Mark Shannon has been improving the sys.monitoring API so that branch coverage can be done with low overhead. I want to take advantage of that in coverage.py, but I needed to do some refactoring work...

Cherish this time
11 Aug 2024 | original ↗

I’m been talking lately with a friend with a four-month-old baby. He mentioned the well-worn dynamic that older parents tell new parents to cherish their early days with their newborn, that they will grow up faster than you expect.I agree with the general sentiment, but I don’t think it’s a good thing to tell new parents. First, let’s be...

Pushing back on sys.monitoring
31 Jul 2024 | original ↗

I’ve been continuing to work on adapting coverage.py to the new sys.monitoring facility. Getting efficient branch coverage has been difficult even with the new API. The latest idea was to compile the code under measurement to insert phantom lines that could trigger line monitoring events that would track branch execution. But I’ve come to the...

Anthropic
16 Jul 2024 | original ↗

I am starting a new job soon at Anthropic, the makers of the Claude large language model.It will be an interesting change for me, for a few reasons. First, I know essentially nothing about how LLMs work and are built. Second, it’s my first new job in almost 12 years. Third, I’ve been “between gigs” for six months, so I have to get back to a...

Coverage at a crossroads
21 Jun 2024 | original ↗

This is an interesting time for coverage.py: I’m trying to make use of new facilities in Python to drastically reduce the execution-time overhead, but it’s raising tricky questions about how coverage should work.The current situation is a bit involved. I’ll try to explain, but this will get long, with a few sections. Come talk in Discord about...

Math factoid of the day: 62
16 Jun 2024 | original ↗

There are two Archimedean solids with 62 faces: rhomb­icosi­dodeca­hedron truncated icosi­dodeca­hedron They both have 62 faces because of their roots in the dodecahedron and icosahedron. They have a face for each of the faces, vertices, and edges of either of those polyhedra: 12 + 20 + 30 = 62.The rhomb­icosi­dodeca­hedron shows up in...

One way to fix Python circular imports
28 May 2024 | original ↗

In Python, a circular import is when two files each try to import the other, causing a failure when a module isn’t fully initialized. The best way to fix this situation is to organize your code in layers so that the importing relationships naturally flow in just one direction. But sometimes it works to simply change the style of import...

Echos of the People API user guide
22 May 2024 | original ↗

PyCon 2024 just happened, and as always it was a whirlwind of re-connecting with old friends, meeting new friends, talking about anything and everything, juggling, and getting simultaneously energized and exhausted. I won’t write about everything that happened, but one thread sticks with me: the continuing echos of my talk from last year.If you...

My flexbox layout
19 Apr 2024 | original ↗

I recently had to reverse engineer the layout of this site. I created it once upon a time, but had forgotten the details, and to save myself the work five years from now when I have to do it again, I’m noting down what I learned about how it works.For pedagogical purposes, I made a simplified example of the layout: toystell.html. The layout...

↑ these items are from RSS. Visit the blog itself at https://nedbatchelder.com/blog to find other articles and to appreciate the author's digital home.