Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.1k
[mypyc] Precompute set literals for "in" ops against / iteration over set literals#14409
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
b0f57abc8d2dda779a5987fabcfe97faab53ccf951de47fef0036e20e1527e2e3d30458d68a7b1b75b7d1a55fa43d44293fefac479cdfc982f18f30File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -131,6 +131,10 @@ def main_negated_set(item: Any) -> bool: | ||
| def non_final_name_set(item: Any) -> bool: | ||
| return item in {non_const} | ||
| s = set() | ||
| for i in {None, False, 1, 2.0, "3", b"4", 5j, (6,), CONST}: | ||
| s.add(i) | ||
| [file driver.py] | ||
| ||
| import native | ||
| from native import CONST, main_set, main_negated_set, non_final_name_set | ||
| @@ -142,3 +146,5 @@ for item in (None, False, 1, 2.0, "3", b"4", 5j, (6,), ((7,),), (), CONST): | ||
| assert non_final_name_set(native.non_const) | ||
| native.non_const = "updated" | ||
| assert non_final_name_set("updated") | ||
| assert not native.s ^ {None, False, 1, 2.0, "3", b"4", 5j, (6,), CONST}, native.s | ||