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
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
Gwenaël Samain
cython
Commits
da537165
Commit
da537165
authored
Jun 18, 2018
by
gabrieldemarmiesse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved an example from string.rst to the examples directory.
parent
5c04c1a8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
docs/examples/tutorial/string/arg_memview.pyx
docs/examples/tutorial/string/arg_memview.pyx
+5
-0
docs/src/tutorial/strings.rst
docs/src/tutorial/strings.rst
+1
-7
No files found.
docs/examples/tutorial/string/arg_memview.pyx
0 → 100644
View file @
da537165
def
process_byte_data
(
unsigned
char
[:]
data
):
length
=
data
.
shape
[
0
]
first_byte
=
data
[
0
]
slice_view
=
data
[
1
:
-
1
]
# ...
docs/src/tutorial/strings.rst
View file @
da537165
...
...
@@ -208,13 +208,7 @@ of byte containers, e.g. :obj:`bytearray` objects or memory views.
Depending on how (and where) the data is being processed, it may be a
good idea to instead receive a 1-dimensional memory view, e.g.
::
def process_byte_data(unsigned char[:] data):
length = data.shape[0]
first_byte = data[0]
slice_view = data[1:-1]
...
.. literalinclude:: ../../examples/tutorial/string/arg_memview.pyx
Cython's memory views are described in more detail in
:doc:`../userguide/memoryviews`, but the above example already shows
...
...
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