New submission from Ezio Melotti <ezio.melo...@gmail.com>:

The documentation for urllib.request.urlopen [0] says that:
"""
This function returns a file-like object [addinfourl] with two additional 
methods from the urllib.response module
    geturl() — return the URL of the resource retrieved, [...]
    info() — return the meta-information of the page, [...]
"""

There's also a third undocumented method: getcode().  Looking at the code[1] 
ISTM that the 3 getters (geturl(), info(), and getcode()):
  1) have an inconsistent interface (why not getinfo() or getheaders()?);
  2) they just return the url, headers, and code attributes;

For these two reasons I propose to:
  * document the 3 attributes as the suggested way to access this information;
  * deprecate the 3 getters;
  * avoid to document the now undocumented getcode();


[0]: http://docs.python.org/py3k/library/urllib.request.html
[1]: Lib/urllib/response.py:83

----------
components: Library (Lib)
keywords: easy
messages: 141756
nosy: ezio.melotti, orsenthil, sandro.tosi
priority: normal
severity: normal
stage: needs patch
status: open
title: Deprecate addinfourl getters
versions: Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12707>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to