Message235582
I also liked the idea of returning None to distinguish a missing URL component from an empty-but-present component, and it would make them more consistent with the “username” and “password” fields. But I agree it would break backwards compabitility too much. The idea of “has_fragment” etc flags might work. The ParseResult etc class signatures could be expanded like this:
SplitResult(scheme, netloc, path, query, fragment, *, has_netloc=None, has_query=None, has_fragment=None)
>>> url1 = SplitResult("http", "localhost", "/path", query="", fragment="")
>>> url1.has_netloc
True
>>> url1.has_fragment
False
>>> url2 = SplitResult("http", "localhost", "/path", query="", fragment="", has_fragment=True)
>>> url2.has_fragment
True
>>> url2.has_query
False
>>> url2.geturl()
"http://localhost/path#"
Is it also worth adding “has_params” for urlparse()? |
|
Date |
User |
Action |
Args |
2015-02-09 02:32:28 | martin.panter | set | recipients:
+ martin.panter, orsenthil, soilandreyes |
2015-02-09 02:32:27 | martin.panter | set | messageid: <1423449147.99.0.474556511986.issue22852@psf.upfronthosting.co.za> |
2015-02-09 02:32:27 | martin.panter | link | issue22852 messages |
2015-02-09 02:32:27 | martin.panter | create | |
|