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. Cheers, Steve _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/6GV3KPPPRNF5ISZK4YSAIUUTCQRMX77H/ Code of Conduct: http://python.org/psf/codeofconduct/