• Sign in
  • Sign up
Elektrine
EN
  • EN English
  • 中 中文
Log in Register
Modes
Overview Search Chat Timeline Communities Gallery Lists Friends Email Vault VPN
Back to Timeline
  • Open on hachyderm.io

Ned Batchelder

@nedbat@hachyderm.io
mastodon 4.5.7

Python, software, coverage.py, typography, juggling, Boston, autism (dad). Laughing at the world doesn't mean I don't take it seriously. He/him.

0 Followers
0 Following
Joined November 16, 2022
Home:
https://nedbatchelder.com
GitHub:
https://github.com/nedbat
Work:
Full-time

Posts

nedbat
Ned Batchelder
@nedbat@hachyderm.io

Python, software, coverage.py, typography, juggling, Boston, autism (dad). Laughing at the world doesn't mean I don't take it seriously. He/him.

hachyderm.io
Ned Batchelder
Ned Batchelder
@nedbat@hachyderm.io

Python, software, coverage.py, typography, juggling, Boston, autism (dad). Laughing at the world doesn't mean I don't take it seriously. He/him.

hachyderm.io
@nedbat@hachyderm.io · Feb 28, 2026

RE: @nedbat@hachyderm.io

The answer to the mystery: because my function had a `yield` in it, it was compiled as a generator. But executing the function never ran `yield`, so iterating it produced an empty sequence. The value from the return statement is ignored.

TBH, I know there is a way to get the returned value, but I have never needed to, and I don't know how.

The solution was to delete the code after the return.

View on hachyderm.io
7
0
2
0
nedbat
Ned Batchelder
@nedbat@hachyderm.io

Python, software, coverage.py, typography, juggling, Boston, autism (dad). Laughing at the world doesn't mean I don't take it seriously. He/him.

hachyderm.io
Ned Batchelder
Ned Batchelder
@nedbat@hachyderm.io

Python, software, coverage.py, typography, juggling, Boston, autism (dad). Laughing at the world doesn't mean I don't take it seriously. He/him.

hachyderm.io
@nedbat@hachyderm.io · Feb 28, 2026

Debugging fail in #Python: I had a generator function:

def them():
for thing in some_things():
yield thing

But I wanted to quickly try changing it to use a helper that returned a list, so I just added that code at the top:

def them():
return them_from_somewhere_else()
for thing in some_things():
yield thing

Took me a while to figure out why `list(them())` was always an empty list.

View on hachyderm.io
10
0
1
0
nedbat
Ned Batchelder
@nedbat@hachyderm.io

Python, software, coverage.py, typography, juggling, Boston, autism (dad). Laughing at the world doesn't mean I don't take it seriously. He/him.

hachyderm.io
Ned Batchelder
Ned Batchelder
@nedbat@hachyderm.io

Python, software, coverage.py, typography, juggling, Boston, autism (dad). Laughing at the world doesn't mean I don't take it seriously. He/him.

hachyderm.io
@nedbat@hachyderm.io · Feb 27, 2026

Pytest's parametrize decorator is awesome! Even better is to use your own functions to populate the data:

https://nedbatchelder.com/blog/202602/pytest_parameter_functions

View on hachyderm.io
13
0
5
0
nedbat
Ned Batchelder
@nedbat@hachyderm.io

Python, software, coverage.py, typography, juggling, Boston, autism (dad). Laughing at the world doesn't mean I don't take it seriously. He/him.

hachyderm.io
Ned Batchelder
Ned Batchelder
@nedbat@hachyderm.io

Python, software, coverage.py, typography, juggling, Boston, autism (dad). Laughing at the world doesn't mean I don't take it seriously. He/him.

hachyderm.io
@nedbat@hachyderm.io · Feb 25, 2026

The AI hype-cyclone is bad, but so is the anti-AI witch hunt. Commits co-authored by Claude do not mean that a project has "abandoned engineering as a serious endeavor"

Would we say that accepting contributions from new developers means we've "abandoned engineering as a serious endeavor"? No.

Claude can write wrong code. New contributors can write wrong code. What matters is what you do with that code after it's been written.

View on hachyderm.io
35
0
14
0
nedbat
Ned Batchelder
@nedbat@hachyderm.io

Python, software, coverage.py, typography, juggling, Boston, autism (dad). Laughing at the world doesn't mean I don't take it seriously. He/him.

hachyderm.io
Ned Batchelder
Ned Batchelder
@nedbat@hachyderm.io

Python, software, coverage.py, typography, juggling, Boston, autism (dad). Laughing at the world doesn't mean I don't take it seriously. He/him.

hachyderm.io
@nedbat@hachyderm.io · Feb 25, 2026
Git won't track empty directories (because at heart it only tracks files). Common advice is to add a '.gitkeep' file so the directory isn't empty and git will make the directory. EVEN BETTER ADVICE: put a README in the directory explaining what the empty directory is for and what will eventually be there.
View on hachyderm.io
513
0
252
0
nedbat
Ned Batchelder
@nedbat@hachyderm.io

Python, software, coverage.py, typography, juggling, Boston, autism (dad). Laughing at the world doesn't mean I don't take it seriously. He/him.

hachyderm.io
Ned Batchelder
Ned Batchelder
@nedbat@hachyderm.io

Python, software, coverage.py, typography, juggling, Boston, autism (dad). Laughing at the world doesn't mean I don't take it seriously. He/him.

hachyderm.io
@nedbat@hachyderm.io · Jan 29, 2026

Thanks, Quansight for supporting open source so forcefully!

https://labs.quansight.org/blog/oss-fund-2025

View on hachyderm.io
17
0
11
0
nedbat
Ned Batchelder
@nedbat@hachyderm.io

Python, software, coverage.py, typography, juggling, Boston, autism (dad). Laughing at the world doesn't mean I don't take it seriously. He/him.

hachyderm.io
Ned Batchelder
Ned Batchelder
@nedbat@hachyderm.io

Python, software, coverage.py, typography, juggling, Boston, autism (dad). Laughing at the world doesn't mean I don't take it seriously. He/him.

hachyderm.io
@nedbat@hachyderm.io · Nov 05, 2025

Forget about trying to get your company to support something abstract like the PSF.

You use PyPI: you know, the place that pip installs from. Wouldn't it be bad if `pip install` stopped working? Support the organization that runs PyPI instead.

Surprise, it's the PSF! Support the PSF! Your company depends on #Python. You want it to keep working and keep being good.

Support the PSF. https://www.python.org/psf/sponsors/

View on hachyderm.io
64
0
76
0
313k7r1n3

Company

  • About
  • Contact
  • FAQ

Legal

  • Terms of Service
  • Privacy Policy
  • VPN Policy

Email Settings

IMAP: imap.elektrine.com:993

POP3: pop.elektrine.com:995

SMTP: smtp.elektrine.com:465

SSL/TLS required

Support

  • support@elektrine.com
  • Report Security Issue

Connect

Tor Hidden Service

khav7sdajxu6om3arvglevskg2vwuy7luyjcwfwg6xnkd7qtskr2vhad.onion
© 2026 Elektrine. All rights reserved. • Server: 10:36:21 UTC