Revive PEP 640 - Unused variable syntax

It’s just a little annoying if I have already given the answer to a question:



This isn’t “repeating an argument”, it’s telling you your communication is confusing and hard to be confident about. I don’t think it’s appropriate to respond to that by telling off the person who didn’t understand what you were trying to say. I also think complaining that people who engage with you in good faith are “annoying” you is very likely to put people off from interacting with you at all.

Now, I know I’m restating previous comments here, but given the previous PEP was rejected for lack of support, I would have expected you to welcome information about what support you are likely to get on this, so here goes:

pylint’s refactoring warnings are deliberately noisy, by design. It would be wagging the dog to take the existing solution for suppressing them and make bespoke language syntax for each one to suppress those warnings. I don’t see a compelling argument here that the code you linked would be any clearer for this: instead of an easy-to-Google warning code, you now have an obscure ? that cannot be easily discovered.

I don’t see a potentially tiny performance improvement as justifying a whole new syntax change either; if nothing else, you would need to demonstrate a clear win over just adding unused assignment analysis to the upcoming JIT, I think.

I believe your new example is more easily solved by using the new @override decorator and having Ruff disable its noisy PLR warning when it sees it.

4 Likes

OK, it indeed looks like it wasn’t very clear in this case I didn’t make the link a one-box, as it wasn’t very important for my argument, my bad.

In that case you can just ask for clarification, then I at least know you read my response.

It’s not about clarity: in the past I didn’t use a type checker leading to unmaintainable code. Now I have 5 linters enabled at the strictest settings. Any type comment I have to add feels like a failure of the language.

That’s all I wanted to say, really. My addition isn’t sufficient to convince anyone.
Thanks for the feedback, I hope I’ll one day suggest something you like.

1 Like

I hope you’ve used this experience to learn more about how suggestions work and how to put something forward.

2 Likes