Mark some urllib.parse return fields optional (#3332)

Per the urllib.parse documentation, username, password, hostname,
and port will be set to None if not set in the parsed URL.  The
same is true for urlparse in Python 2 according to its documentation.
This commit is contained in:
Russ Allbery authored and Sebastian Rittau committed 2019-10-09 19:38:59 +02:00
1 parent 07c8675ba5
commit f0ccb325aa
2 files changed
+9 -9

No files matched your search

+4 -4
View File
@@ -25,10 +25,10 @@ class _ResultMixinBytes(_ResultMixinBase[str]):
class _NetlocResultMixinBase(Generic[AnyStr]):
username: AnyStr
password: AnyStr
hostname: AnyStr
port: int
username: Optional[AnyStr]
password: Optional[AnyStr]
hostname: Optional[AnyStr]
port: Optional[int]
class _NetlocResultMixinStr(_NetlocResultMixinBase[str], _ResultMixinStr): ...