On 12/16/20 2:08 AM, Markus Armbruster wrote:
We all have our phobias. I find "isinstance(x,
extremely_common_stdlib_type)" to be extremely fragile and likely to
frustrate.
You're applying programming-in-the-large reasoning to a
programming-in-the-small case.


"Surely, they won't use my proof of concept code in production!"

Ah, alas, ...

Say you're writing a piece of code you expect to be used in contexts you
prudently refuse to predict.  The code deals with a bunch of basic
Python types.  Reserving another basic Python type for internal use may
well be unwise then, because it can make your code break confusingly
when this other type appears in input.  Which it shouldn't, but making
your reusable code harder to misuse, and misuses easier to diagnose are
laudable goals.

This is not such a piece of code.  All the users it will ever have are
in the same file of 200-something LOC.


I'm just saying that this type of code has bitten me in the ass before. You're right that it's not likely to bite someone explicitly here, but that's indeed why it came in the "Also, ..." section.

I've reworked the commit message a bit by now, but I suspect you'll still want to take the red marker to it a bit.

--js


Reply via email to