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
e157fc47
Commit
e157fc47
authored
Dec 11, 2002
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update comments about the performance of xrange().
parent
65c2ca03
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
Doc/lib/libstdtypes.tex
Doc/lib/libstdtypes.tex
+2
-2
Objects/rangeobject.c
Objects/rangeobject.c
+2
-2
No files found.
Doc/lib/libstdtypes.tex
View file @
e157fc47
...
...
@@ -884,8 +884,8 @@ xrange object will always take the same amount of memory, no matter the
size of the range it represents. There are no consistent performance
advantages.
XRange objects have very little behavior: they only support indexing
and the
\function
{
len()
}
function.
XRange objects have very little behavior: they only support indexing
,
iteration,
and the
\function
{
len()
}
function.
\subsubsection
{
Mutable Sequence Types
\label
{
typesseq-mutable
}}
...
...
Objects/rangeobject.c
View file @
e157fc47
...
...
@@ -113,8 +113,8 @@ PyDoc_STRVAR(range_doc,
"xrange([start,] stop[, step]) -> xrange object
\n
\
\n
\
Like range(), but instead of returning a list, returns an object that
\n
\
generates the numbers in the range on demand.
This is slightly slower
\n
\
than range() but
more memory efficient."
);
generates the numbers in the range on demand.
For looping, this is
\n
\
slightly faster than range() and
more memory efficient."
);
static
PyObject
*
range_item
(
rangeobject
*
r
,
int
i
)
...
...
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