3 ms·
Agreed. They should have required an extra token like ? to disambiguate bindings from evaluations. Not only would it avert this pitfall, it would also obviate t
by pwdisswordfish6 6y ago
Agreed. They should have required an extra token like ? to disambiguate bindings from evaluations. Not only would it avert this pitfall, it would also obviate the need to have a special identifier to discard a bound value; instead of writing _ to discard a binding, one would just write ? without a variable name.
I fear a poor design like this is going to not only discourage people from using the feature at all, it is also going to poison the well and discourage people from using pattern matching in languages with a much more robust implementation. Which is a shame, because I actually like pattern matching.
(Tinfoil-hat take: Maybe that’s the whole point, after all Guido doesn’t like functional programming.)
- r-zip 6y agoSince the names have to be dotted anyway, why not .var_name? I feel like this implementation is seriously half-baked.
- gshulegaard 6y agoI could be wrong, but this PEP feels to me like it only got accepted because Guido is stepping (or stepped) back from his BDFL role. It has noticeably more rough edges and less consistency than most feature adds I have seen in the past. This is pure personal speculation though.
- enragedcacti 6y agoGuido sponsored the PEP so I doubt him being BDFL would have stopped it.