2323try :
2424 from socket import AddressFamily
2525except ImportError :
26- AddressFamily = int # type: ignore[assignment,misc] Python 2
26+ AddressFamily = int # type: ignore[assignment,misc]
2727from typing import (
2828 Any , Callable , Dict , Iterable , Iterator , List , Mapping , Optional ,
2929 Sequence , Text , Tuple , Type , TypeVar , Union , cast ,
@@ -97,7 +97,7 @@ def __repr__(self):
9797 if var_name :
9898 # superclass type hints don't allow str return type, but it is
9999 # allowed in the docs, hence the ignore[override] below
100- def __reduce__ (self ): # type: ignore[override] intentional
100+ def __reduce__ (self ): # type: ignore[override]
101101 # type: () -> str
102102 return self .var_name
103103
@@ -110,7 +110,7 @@ def __nonzero__(self):
110110 return Sentinel ()
111111
112112
113- _unspecified = _UNSET = make_sentinel ('_UNSET' )
113+ _unspecified = _UNSET = make_sentinel ('_UNSET' ) # type: Any
114114
115115
116116# RFC 3986 Section 2.3, Unreserved URI Characters
@@ -466,15 +466,15 @@ def _textcheck(name, value, delims=frozenset(), nullable=False):
466466 if not isinstance (value , Text ):
467467 if nullable and value is None :
468468 # used by query string values
469- return value # type: ignore[misc] unreachable
469+ return value # type: ignore[misc] # unreachable
470470 else :
471471 str_name = "unicode" if PY2 else "str"
472472 exp = str_name + ' or NoneType' if nullable else str_name
473473 raise TypeError ('expected %s for %s, got %r' % (exp , name , value ))
474474 if delims and set (value ) & set (delims ): # TODO: test caching into regexes
475475 raise ValueError ('one or more reserved delimiters %s present in %s: %r'
476476 % ('' .join (delims ), name , value ))
477- return value # type: ignore[return-value] T vs. Text
477+ return value # type: ignore[return-value] # T vs. Text
478478
479479
480480def iter_pairs (iterable ):
@@ -1089,7 +1089,7 @@ def absolute(self):
10891089 """
10901090 return bool (self .scheme and self .host )
10911091
1092- def replace ( # type: ignore[assignment] _UNSET is private
1092+ def replace (
10931093 self ,
10941094 scheme = _UNSET , # type: Optional[Text]
10951095 host = _UNSET , # type: Optional[Text]
@@ -1194,7 +1194,7 @@ def from_text(cls, text):
11941194 port = au_gs ['port' ]
11951195 if port is not None :
11961196 try :
1197- port = int (port ) # type: ignore[assignment] FIXME, also below
1197+ port = int (port ) # type: ignore[assignment] # FIXME, see below
11981198 except ValueError :
11991199 if not port : # TODO: excessive?
12001200 raise URLParseError ('port must not be empty: %r' % au_text )
@@ -1227,7 +1227,7 @@ def from_text(cls, text):
12271227 query = ()
12281228 return cls (
12291229 scheme , host , path , query , fragment ,
1230- port , # type: ignore[arg-type] FIXME, also above
1230+ port , # type: ignore[arg-type] # FIXME, see above
12311231 rooted , userinfo , uses_netloc ,
12321232 )
12331233
@@ -1323,7 +1323,7 @@ def child(self, *segments):
13231323 if not segments :
13241324 return self
13251325
1326- segments = [ # type: ignore[assignment] variable is tuple
1326+ segments = [ # type: ignore[assignment] # variable is tuple
13271327 _textcheck ('path segment' , s ) for s in segments
13281328 ]
13291329 new_path = tuple (self .path )
@@ -1679,7 +1679,7 @@ def get(self, name):
16791679 """
16801680 return [value for (key , value ) in self .query if name == key ]
16811681
1682- def remove ( # type: ignore[assignment] _UNSET is private
1682+ def remove (
16831683 self ,
16841684 name , # type: Text
16851685 value = _UNSET , # type: Text
@@ -1863,7 +1863,7 @@ def path(self):
18631863 try :
18641864 return cast (
18651865 Tuple [Text , ...],
1866- self ._path # type: ignore[has-type] can't determine
1866+ self ._path # type: ignore[has-type] # can't determine
18671867 )
18681868 except AttributeError :
18691869 pass
@@ -1879,7 +1879,7 @@ def query(self):
18791879 try :
18801880 return cast (
18811881 QueryPairs ,
1882- self ._query # type: ignore[has-type] can't determine
1882+ self ._query # type: ignore[has-type] # can't determine
18831883 )
18841884 except AttributeError :
18851885 pass
@@ -1899,7 +1899,7 @@ def fragment(self):
18991899 try :
19001900 return cast (
19011901 Text ,
1902- self ._fragment # type: ignore[has-type] can't determine
1902+ self ._fragment # type: ignore[has-type] # can't determine
19031903 )
19041904 except AttributeError :
19051905 pass
@@ -1913,7 +1913,7 @@ def userinfo(self):
19131913 try :
19141914 return cast (
19151915 Union [Tuple [str ], Tuple [str , str ]],
1916- self ._userinfo # type: ignore[has-type] can't determine
1916+ self ._userinfo # type: ignore[has-type] # can't determine
19171917 )
19181918 except AttributeError :
19191919 pass
@@ -1938,7 +1938,7 @@ def uses_netloc(self):
19381938 # type: () -> bool
19391939 return cast (bool , self ._url .uses_netloc )
19401940
1941- def replace ( # type: ignore[assignment] _UNSET is private
1941+ def replace (
19421942 self ,
19431943 scheme = _UNSET , # type: Optional[Text]
19441944 host = _UNSET , # type: Optional[Text]
@@ -2007,7 +2007,7 @@ def set(self, name, value=None):
20072007 q [idx :idx ] = [(name , value )]
20082008 return self .replace (query = q )
20092009
2010- def remove ( # type: ignore[assignment] _UNSET is private
2010+ def remove (
20112011 self ,
20122012 name , # type: Text
20132013 value = _UNSET , # type: Text
0 commit comments