Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
afdabfd0
Commit
afdabfd0
authored
Sep 10, 2008
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some typos.
parent
9d282cca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
Doc/library/stdtypes.rst
Doc/library/stdtypes.rst
+9
-9
No files found.
Doc/library/stdtypes.rst
View file @
afdabfd0
...
...
@@ -2237,17 +2237,17 @@ memoryview Types
================
:class:`memoryview`\s allow Python code to access the internal data of an object
that supports the buffer protocol
. Memory can be interpreted as simple bytes or
complex data structures.
that supports the buffer protocol
without copying. Memory can be interpreted as
simple bytes or
complex data structures.
.. class:: memoryview(obj)
Create a :class:`memoryview`
\s
that references *obj*. *obj* must support the
Create a :class:`memoryview` that references *obj*. *obj* must support the
buffer protocol. Builtin objects that support the buffer protocol include
:class:`bytes` and :class:`bytearray`.
A :class:`memoryview`
\s
supports slicing to expose its data. Taking a single
index will return a single byte. Full slicing will result in a subview
/
::
A :class:`memoryview` supports slicing to expose its data. Taking a single
index will return a single byte. Full slicing will result in a subview::
>>> v = memoryview(b'abcefg')
>>> v[1]
...
...
@@ -2262,8 +2262,8 @@ complex data structures.
<memory at 0x744f18>
>>> bytes(v[4:-1])
If the object the memory
view is over supports changing it'
s data, the
memoryview supports slice assignment
.
::
If the object the memory
view is over supports changing it
s data, the
memoryview supports slice assignment::
>>> data = bytearray(b'abcefg')
>>> v = memoryview(data)
...
...
@@ -2302,8 +2302,8 @@ complex data structures.
.. attribute:: shape
A tuple of integers the length of :attr:`
~memoryview.ndim` giving
the
shape of the
memory as a N-dimensional array.
A tuple of integers the length of :attr:`
ndim` giving the shape of
the
memory as a N-dimensional array.
.. attribute:: ndim
...
...
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