Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stdlib
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cython-plus
stdlib
Commits
0d3108ce
Commit
0d3108ce
authored
Oct 12, 2022
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Str.__getitem__
parent
8520b76d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
string.pxd
string.pxd
+5
-7
No files found.
string.pxd
View file @
0d3108ce
...
...
@@ -43,14 +43,12 @@ cdef cypclass Str "Cy_Str":
char
__getitem__
(
self
,
int
index
)
except
0
:
cdef
int
end
=
self
.
_str
.
size
()
cdef
int
idx
=
index
if
index
<
0
:
index
=
-
index
idx
=
end
-
index
if
index
>=
end
:
with
gil
:
raise
ValueError
(
'index out of range'
)
return
self
.
_str
[
idx
]
index
=
end
+
index
if
0
<=
index
<
end
:
return
self
.
_str
[
index
]
with
gil
:
raise
ValueError
(
'index out of range'
)
int
find
(
self
,
Str
s
,
size_t
start
=
0
,
size_t
stop
=
0
):
if
start
<
stop
and
stop
<=
self
.
_str
.
size
():
...
...
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