Martin Panter added the comment: I would go for raising ValueError for port numbers out of range. The value of None was already defined to mean that no port is included in the URL.
Also, the ValueError exception should be documented. It is surprising that urlsplit() does not raise any exception, but then simply getting the “port” attribute does raise the exception. BTW your third example is wrong: >>> urlparse("http://www.example.com:").port is None True It’s probably safest to keep this one as it is, but maybe it also needs documenting :) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20059> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com