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
42182eba
Commit
42182eba
authored
Mar 09, 2003
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SF 698520: Iterator for urllib.URLOpener
Contributed by Brett Cannon.
parent
e9e20a98
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
Doc/lib/liburllib.tex
Doc/lib/liburllib.tex
+2
-1
Lib/urllib.py
Lib/urllib.py
+4
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Doc/lib/liburllib.tex
View file @
42182eba
...
...
@@ -27,7 +27,8 @@ if the server returns an error code, the \exception{IOError} exception
is raised. If all went well, a file-like object is returned. This
supports the following methods:
\method
{
read()
}
,
\method
{
readline()
}
,
\method
{
readlines()
}
,
\method
{
fileno()
}
,
\method
{
close()
}
,
\method
{
info()
}
and
\method
{
geturl()
}
.
\method
{
info()
}
and
\method
{
geturl()
}
. It also has proper support for
the iterator protocol.
Except for the
\method
{
info()
}
and
\method
{
geturl()
}
methods,
these methods have the same interface as for
...
...
Lib/urllib.py
View file @
42182eba
...
...
@@ -780,6 +780,10 @@ class addbase:
self
.
readline
=
self
.
fp
.
readline
if
hasattr
(
self
.
fp
,
"readlines"
):
self
.
readlines
=
self
.
fp
.
readlines
if
hasattr
(
self
.
fp
,
"fileno"
):
self
.
fileno
=
self
.
fp
.
fileno
if
hasattr
(
self
.
fp
,
"__iter__"
):
self
.
__iter__
=
self
.
fp
.
__iter__
if
hasattr
(
self
.
fp
,
"next"
):
self
.
next
=
self
.
fp
.
next
def
__repr__
(
self
):
return
'<%s at %s whose fp = %s>'
%
(
self
.
__class__
.
__name__
,
...
...
Misc/NEWS
View file @
42182eba
...
...
@@ -46,6 +46,9 @@ Extension modules
Library
-------
- The urllib module now offers support for the iterator protocol.
SF patch 698520 contributed by Brett Cannon.
- New module timeit provides a simple framework for timing the
execution speed of expressions and statements.
...
...
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