
On Wed, 15 Jun 2022 at 22:38, Steven D'Aprano <steve@pearwood.info> wrote:
There's no consensus that this feature is worth the added complexity, or even what the semantics are. The PEP punts on the semantics, saying that the behaviour may vary across implementations.
Excuse me? I left one or two things open-ended, where they're bad code and I'm not going to lock the language into supporting them just because the reference implementation happens to be able to, but "punts"? That's a bit much. The semantics are QUITE specific.
There's no consensus on the syntax, which may not matter, the Steering Council can make the final decision if necessary. But with at least four options in the PEP it would be good to narrow it down a bit. No soft keywords have been considered.
"""Choice of spelling. While this document specifies a single syntax `name=>expression`...""" The PEP specifies *one* option.
In my opinion, there are weaknesses in the PEP:
- lack of any reference to previous discussions;
- no attempt to gather feedback from other forums;
- no review of languages that offer choice of early or late binding;
- little attempt to justify why this is better than the status quo; the PEP seems to take the position that it is self-evident that Python needs this feature, rather than being a balanced document setting out both pros and cons;
- little or no attempt in the PEP to answer objections;
- examples are all chosen to show the feature in the best possible light, rather than to show both the good and bad; (e.g. no examples show the parameter with annotations)
- failure to acknowledge that at least one of the suggested syntaxes is visually ambiguous with existing syntax.
E.g. this would be legal with the PEP's second choice of spelling:
def func(spam, eggs:=(x:=spam)):
Even if the parser can distinguish the two uses of `:=` there, its awfully cryptic. In and of itself, that's not necessarily a fatal flaw (e.g. slicing) but the benefits have to outweigh the negatives, and the PEP should be a balanced discussion of both.
And that's not the recommended syntax anyway. Please, if you're going to criticize the document, *at least* have the decency to check your facts. You are the PRIMARY reason that I gave up pushing this earlier. I am within a very short span of blocking you in my mail client and refusing to respond to your emails, because it feels like a massive waste of my time trying. ChrisA