Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
JukkaL merged 17 commits intopython:masterfromichard26:faster-in-for-set-literals
Jan 10, 2023
Merged
Changes from1 commit
Commits
Show all changes
17 commits
Select commitHold shift + click to select a range
b0f57ab
mypyc: cherry picked wip from a year ago
ichard26Aug 12, 2021
c8d2dda
[wip] [mypyc] Precompute set literals for in ops
ichard26Aug 24, 2022
779a598
Stablize pprint of frozenset literals
ichard26Jan 6, 2023
7fabcfe
Fix byte literals & clean up precompute_set_literal()
ichard26Jan 6, 2023
97faab5
[wip] more tests
ichard26Jan 6, 2023
3ccf951
Update irbuild and add run tests
ichard26Jan 6, 2023
de47fef
Merge branch 'master' into faster-in-for-set-literals
ichard26Jan 6, 2023
0036e20
Clean up patch & add boolean to tests
ichard26Jan 6, 2023
e1527e2
Optimize for ... in <set-literal>
ichard26Jan 7, 2023
e3d3045
Oh look, I found constant_fold_expr()
ichard26Jan 7, 2023
8d68a7b
Run flake8/isort
ichard26Jan 7, 2023
1b75b7d
I forgot Final is a 3.8+ feature >.<
ichard26Jan 7, 2023
1a55fa4
Work around mypyc bug ...
ichard26Jan 7, 2023
3d44293
Work around mypyc bug ... attempt 2
ichard26Jan 7, 2023
fefac47
Work around mypyc bug ... attempt 3
ichard26Jan 7, 2023
9cdfc98
Add error handling + use test_* syntax instead
ichard26Jan 9, 2023
2f18f30
Improve precompute_set_literal() docstring
ichard26Jan 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Run flake8/isort
  • Loading branch information
@ichard26
ichard26 committedJan 7, 2023
commit8d68a7b9352a248299875830c00a79b780e7d50d
11 changes: 5 additions & 6 deletionsmypyc/codegen/literals.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

from typing import Any, FrozenSet, List, Tuple, Union, cast

from typing_extensions import Final

# Supported Python literal types. All tuple / frozenset items must have supported
Expand DownExpand Up@@ -157,11 +156,11 @@ def _encode_collection_values(
count = len(values)
result.append(str(count))
for i in range(count):
value = value_by_index[i]
result.append(str(len(value)))
for item in value:
index = self.literal_index(cast(Any, item))
result.append(str(index))
value = value_by_index[i]
result.append(str(len(value)))
for item in value:
index = self.literal_index(cast(Any, item))
result.append(str(index))
return result


Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp