-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-46072: Include length in stats for UNPACK_SEQUENCE. #31254
bpo-46072: Include length in stats for UNPACK_SEQUENCE. #31254
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I'm curious to see the results.
(I'm gonna be really surprised if anybody is out here unpacking zero-length iterables, though.)
To my surprise, this works:
|
...for some definition of "works". The whole thing gets peepholed out. ;) I think maybe once long ago I used something like this to "assert" that an iterator I used was completely exhausted (the idea being that it would raise a it = iter(something)
# ...do some stuff...
[] = it # Fails if there are any remaining items. I thought it was pretty clever at the time. :) |
def f(x):
match x:
case T():
pass
|
Interesting. That's a common case that's worth improving. |
Even more stats!
https://bugs.python.org/issue46072