Brandt Bucher <brandtbuc...@gmail.com> added the comment:

> Are you sure you want to do this?

No, not yet. But there has been some positive feedback here, and it seems like 
an interesting project to prototype. :)

> This optimisation is not applicable if the matched values are given symbolic 
> names. You would be encouraging people to write bad code with lots of 
> literals, for speed.

I had the same concern initially, but I'm honestly not losing too much sleep 
over it. Literals already get lots of optimizations that symbolic constants 
don't, and to me it seems a bit silly to avoid optimizing literals here when it 
is quite straightforward (and powerful) to do so. There are also many cases 
where using symbolic constants for certain literals doesn't make much sense.

I'd be okay not loudly publicizing this change if it lands. After all, I'm the 
guy who spent the better part of a year trying to convince people that this is 
Not A Switch Statement. :)

(Although, on the flip side, maybe it will help appease the people who have 
been asking for one all these years.)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44283>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to