On 20Oct2020 1021, Steven D'Aprano wrote:
In my opinion, having a convention to treat certain variables as "unused" is great (I'm partial to `__` myself, to avoid clobbering the special variable `_` in the REPL). But having that be a pseudo-variable which is *actually* unused and unuseable strikes me as being an attractive nuisance.
I agree entirely. The convention is fine, and the workaround for when you don't want to overwrite a legitimate `_` variable is also fine.
Making `_` enough of an official convention (but how?) that linting tools stop warning about it (e.g. type checkers might warn about multiple conflicting assignments) seems like an overall happier path, that neither makes existing code forwards-incompatible nor future code backwards-incompatible.
I don't think we have to codify every emergent coding pattern in syntax.