Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
2d75b4bf
Commit
2d75b4bf
authored
Feb 18, 2013
by
zaur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for unicode slicing
parent
de667b62
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
tests/run/unicode_slicing.pyx
tests/run/unicode_slicing.pyx
+16
-0
No files found.
tests/run/unicode_slicing.pyx
0 → 100644
View file @
2d75b4bf
# coding=utf-8
__doc__
=
u"""
>>> do_slice(u'abcdef', 2, 3)
(u'c', u'cdef', u'ab', u'abcdef')
>>> do_slice(u'abcdef', 0, 5)
(u'abcde', u'abcdef', u'', u'abcdef')
"""
import
sys
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
__doc__
.
replace
(
u"(u'"
,
u"('"
).
replace
(
u" u'"
,
u" '"
)
def
do_slice
(
unicode
s
,
int
i
,
int
j
):
return
s
[
i
:
j
],
s
[
i
:],
s
[:
i
],
s
[:]
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