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
bf049f49
Commit
bf049f49
authored
Feb 07, 2015
by
scoder
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #370 from larsmans/buffer-doc
Fixes for buffer protocol docs
parents
3c58789f
ff78ab32
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
docs/src/userguide/buffer.rst
docs/src/userguide/buffer.rst
+5
-5
No files found.
docs/src/userguide/buffer.rst
View file @
bf049f49
...
@@ -66,23 +66,23 @@ which Cython handles specially.
...
@@ -66,23 +66,23 @@ which Cython handles specially.
self.shape[1] = self.ncols
self.shape[1] = self.ncols
# Stride 1 is the distance, in bytes, between two items in a row;
# Stride 1 is the distance, in bytes, between two items in a row;
# this is the distance between two adja
nce
items in the vector.
# this is the distance between two adja
cent
items in the vector.
# Stride 0 is the distance between the first elements of adjacent rows.
# Stride 0 is the distance between the first elements of adjacent rows.
self.strides[1] = <Py_ssize_t>( <char *>&(self.v[1])
self.strides[1] = <Py_ssize_t>( <char *>&(self.v[1])
- <char *>&(self.v[0]))
- <char *>&(self.v[0]))
self.strides[0] = self.ncols * self.strides[1]
self.strides[0] = self.ncols * self.strides[1]
buffer.buf = <char *>&(self.v[0])
buffer.buf = <char *>&(self.v[0])
buffer.format = 'f'
buffer.format = 'f'
# float
buffer.internal = NULL
buffer.internal = NULL
# see References
buffer.itemsize = itemsize
buffer.itemsize = itemsize
buffer.len = self.v.size() * itemsize
buffer.len = self.v.size() * itemsize
# product(shape) * itemsize
buffer.ndim = 2
buffer.ndim = 2
buffer.obj = self
buffer.obj = self
buffer.readonly = 0
buffer.readonly = 0
buffer.shape = self.shape
buffer.shape = self.shape
buffer.strides = self.strides
buffer.strides = self.strides
buffer.suboffsets = NULL
buffer.suboffsets = NULL
# for pointer arrays only
def __releasebuffer__(self, Py_buffer *buffer):
def __releasebuffer__(self, Py_buffer *buffer):
pass
pass
...
...
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