Content-Length: 309310 | pFad | http://github.com/python/mypy/pull/18951/commits/71988981c1e619ff92036ae27bc496727d79994e

99 [mypyc] Add primitive for bytes decode() method by EvgenyVashkevich · Pull Request #18951 · python/mypy · GitHub
Skip to content

[mypyc] Add primitive for bytes decode() method #18951

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
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
Prev Previous commit
add more tests
  • Loading branch information
EvgenyVashkevich committed May 6, 2025
commit 71988981c1e619ff92036ae27bc496727d79994e
35 changes: 25 additions & 10 deletions mypyc/test-data/irbuild-bytes.test
Original file line number Diff line number Diff line change
Expand Up @@ -191,31 +191,40 @@ def f(b: bytes) -> None:
b.decode()
b.decode('utf8')
b.decode('utf-8', 'strict')
b.decode('utf-8', 'strict')
b.decode('latin-1')
b.decode('latin1', 'strict')
b.decode('ascii')
b.decode('latin-1')
b.decode('ascii', 'strict')
b.decode('utf-8', 'ignore')
b.decode('ascii', 'replace')
b.decode('latin1', 'ignore')
b'test_utf8'.decode('utf8')
b'test_latin1'.decode('latin1')
b'test_ascii'.decode('ascii')
[out]
def f(b):
b :: bytes
r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21 :: str
r22 :: bytes
r23 :: str
r24 :: bytes
r25 :: str
r26 :: bytes
r27 :: str
L0:
r0 = CPy_DecodeUtf8(b)
r1 = CPy_DecodeUtf8(b)
r2 = 'utf-8'
r3 = 'strict'
r4 = CPy_Decode(b, r2, r3)
r5 = 'utf-8'
r6 = 'strict'
r7 = CPy_Decode(b, r5, r6)
r8 = 'latin1'
r9 = 'strict'
r10 = CPy_Decode(b, r8, r9)
r11 = CPy_DecodeAscii(b)
r12 = CPy_DecodeLatin1(b)
r5 = CPy_DecodeLatin1(b)
r6 = 'latin1'
r7 = 'strict'
r8 = CPy_Decode(b, r6, r7)
r9 = CPy_DecodeAscii(b)
r10 = 'ascii'
r11 = 'strict'
r12 = CPy_Decode(b, r10, r11)
r13 = 'utf-8'
r14 = 'ignore'
r15 = CPy_Decode(b, r13, r14)
Expand All @@ -225,4 +234,10 @@ L0:
r19 = 'latin1'
r20 = 'ignore'
r21 = CPy_Decode(b, r19, r20)
r22 = b'test_utf8'
r23 = CPy_DecodeUtf8(r22)
r24 = b'test_latin1'
r25 = CPy_DecodeLatin1(r24)
r26 = b'test_ascii'
r27 = CPy_DecodeAscii(r26)
return 1
Loading








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/python/mypy/pull/18951/commits/71988981c1e619ff92036ae27bc496727d79994e

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy