Tomasz Melcer <li...@o2.pl> added the comment:

If __str__ is meant to be a user-understandable way of expressing an URL, the 
best way to do that is to show it the same way user sees it in usually. This is 
now done by .geturl() call.

This way I wouldn't have to remember to serialize it in cases where I want to 
display an URL to user:

    url = urlparse.urlparse(sys.args[1])
    ...
    print "Downloading {1}".format(url)

would mean: "show me that URL".

And if you would like to display its internal representation as a record of 
scheme/host/path/..., you always have __repr__. Currently both __str__ and 
__repr__ return `ParsedResult(scheme="http", netloc='example.com', ...)`

----------

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

Reply via email to