Author Dima.Tisnek
Recipients Dima.Tisnek, Ma Lin, Mariatta, ned.deily, njs, ronaldoussoren
Date 2020-04-07.08:41:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Wow, very curious.

Yes, it's very much like `socket.TCP_KEEPCNT` in that respect, though, admittedly I don't have a very old Mac to test this right now. I think there were VMs for that maybe? 🤔

I wonder, what failure would be best for a naive code below, a NameError or OSError(errno=42)?

sock.setsockopt(socket.SOL_TCP, socket.TCP_NOTSENT_LOWAT, 42)

I guess the question is, at what level should the users catch exceptions...
After all, we don't delete this constant on Linux, and surely someone somewhere runs a very old kernel...

Oddly according to none (in the OSS community) appears to be using this feature yet?

The search without `socket.` prefix yields a bunch of vendored mypy pyi's, but no actual code either.

And some even work around the constant being optional:

So, would this be a "not a regression" if none appears to use this constant yet?

Or do we take "don't break existing code" so seriously, that in this case too, we ought to assume that there's someone out there who has private code like below which we must not break?:

if code := getattr(socket, "TCP_NOTSENT_LOWAT", None):
    sock.setsockopt(socket.SOL_TCP, code, 42)

If someone wants to take forward, by all means :)
Or I can try to hack up delete-at-runtime...
Date User Action Args
2020-04-07 08:41:21Dima.Tisneksetrecipients: + Dima.Tisnek, ronaldoussoren, ned.deily, njs, Ma Lin, Mariatta
2020-04-07 08:41:21Dima.Tisneksetmessageid: <>
2020-04-07 08:41:21Dima.Tisneklinkissue40060 messages
2020-04-07 08:41:20Dima.Tisnekcreate