Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
pygolang
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
pygolang
Commits
3b7128c1
Commit
3b7128c1
authored
Oct 23, 2022
by
Kirill Smelkov
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X patch builtin str/unicode
Needs
cython@ed7c54e9
.
parent
513be11e
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
315 additions
and
16 deletions
+315
-16
golang/_golang_str.pyx
golang/_golang_str.pyx
+314
-15
golang/golang_str_test.py
golang/golang_str_test.py
+1
-1
No files found.
golang/_golang_str.pyx
View file @
3b7128c1
This diff is collapsed.
Click to expand it.
golang/golang_str_test.py
View file @
3b7128c1
...
@@ -2498,7 +2498,7 @@ def bench_bencode(b):
...
@@ -2498,7 +2498,7 @@ def bench_bencode(b):
# xbytes/xunicode/xbytearray convert provided bytes/unicode object to bytes,
# xbytes/xunicode/xbytearray convert provided bytes/unicode object to bytes,
# unicode or bytearray correspondingly to function name.
# unicode or bytearray correspondingly to function name.
def
xbytes
(
x
):
return
x
.
encode
(
'utf-8'
)
if
type
(
x
)
is
unicode
else
x
def
xbytes
(
x
):
return
_bdata
(
x
.
encode
(
'utf-8'
)
if
type
(
x
)
is
unicode
else
x
)
def
xunicode
(
x
):
return
x
.
decode
(
'utf-8'
)
if
type
(
x
)
is
bytes
else
x
def
xunicode
(
x
):
return
x
.
decode
(
'utf-8'
)
if
type
(
x
)
is
bytes
else
x
def
xbytearray
(
x
):
return
bytearray
(
xbytes
(
x
))
def
xbytearray
(
x
):
return
bytearray
(
xbytes
(
x
))
...
...
Kirill Smelkov
@kirr
mentioned in merge request
nexedi/pygolang!21
·
Nov 16, 2022
mentioned in merge request
nexedi/pygolang!21
mentioned in merge request nexedi/pygolang!21
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment