On Thu, 26 Nov 2020 14:18:20 -0800 Guido van Rossum firstname.lastname@example.org wrote:
On Thu, Nov 26, 2020 at 3:11 AM Paul Sokolovsky email@example.com wrote:
I think there is a case to be made for adding "let" to Python. Would you like to write a PEP? I recommend that you find a co-author who can help you write a convincing motivation to sway the Steering Council (not me).
Thanks for encouragement, but process-wise, I think it would be rejected just because it's written by me ;-). So, I'd prefer it were written by somebody else.
That said, even rejected or permanently deferred PEPs still have their value, so I'll keep that in mind, for a case that nobody beats me on it.
(Why do I propose "let" and not "const"? It seems "let" has become the industry standard language. The other day I saw a reference to a LET() function in Excel. :-)
Note that many functional languages conflate the matter of introducing new variable binding (which are lexically nested per the computation theory best practices) and immutability. For an imperative language like Python we shouldn't fall into that trap. If anything, the mental model for "let" should be ol' good BASIC, where "LET", well, introduces a variable (well, it's semantically null, the point that there's no "immutability" connotation).