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
Xavier Thompson
cython
Commits
7df80dec
Commit
7df80dec
authored
9 years ago
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #447 from larsmans/buffer-doc
some more minor fixes to the buffer docs
parents
019a92e8
de37a9ec
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
docs/src/userguide/buffer.rst
docs/src/userguide/buffer.rst
+2
-2
No files found.
docs/src/userguide/buffer.rst
View file @
7df80dec
...
...
@@ -32,7 +32,7 @@ but rows can be added dynamically.
"""Adds a row, initially zero-filled."""
self.v.extend(self.ncols)
There are no me
mber
s to do anything productive with the matrices' contents.
There are no me
thod
s to do anything productive with the matrices' contents.
We could implement custom ``__getitem__``, ``__setitem__``, etc. for this,
but instead we'll use the buffer protocol to expose the matrix's data to Python
so we can use NumPy to do useful work.
...
...
@@ -57,7 +57,7 @@ which Cython handles specially.
def add_row(self):
"""Adds a row, initially zero-filled."""
self.v.
resize(self.v.size() +
self.ncols)
self.v.
extend(
self.ncols)
def __getbuffer__(self, Py_buffer *buffer, int flags):
cdef Py_ssize_t itemsize = sizeof(self.v[0])
...
...
This diff is collapsed.
Click to expand it.
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