@@ -1157,7 +1157,7 @@ def __init__(self, default):
1157
1157
if isinstance (default , (tuple , list )):
1158
1158
self .__default__ = tuple ((typing ._type_check (d , "Default must be a type" )
1159
1159
for d in default ))
1160
- elif default :
1160
+ elif default != _marker :
1161
1161
self .__default__ = typing ._type_check (default , "Default must be a type" )
1162
1162
else :
1163
1163
self .__default__ = None
@@ -1171,7 +1171,7 @@ class TypeVar(typing.TypeVar, _DefaultMixin, _root=True):
1171
1171
1172
1172
def __init__ (self , name , * constraints , bound = None ,
1173
1173
covariant = False , contravariant = False ,
1174
- default = None , infer_variance = False ):
1174
+ default = _marker , infer_variance = False ):
1175
1175
super ().__init__ (name , * constraints , bound = bound , covariant = covariant ,
1176
1176
contravariant = contravariant )
1177
1177
_DefaultMixin .__init__ (self , default )
@@ -1258,7 +1258,7 @@ class ParamSpec(typing.ParamSpec, _DefaultMixin, _root=True):
1258
1258
__module__ = 'typing'
1259
1259
1260
1260
def __init__ (self , name , * , bound = None , covariant = False , contravariant = False ,
1261
- default = None ):
1261
+ default = _marker ):
1262
1262
super ().__init__ (name , bound = bound , covariant = covariant ,
1263
1263
contravariant = contravariant )
1264
1264
_DefaultMixin .__init__ (self , default )
@@ -1334,7 +1334,7 @@ def kwargs(self):
1334
1334
return ParamSpecKwargs (self )
1335
1335
1336
1336
def __init__ (self , name , * , bound = None , covariant = False , contravariant = False ,
1337
- default = None ):
1337
+ default = _marker ):
1338
1338
super ().__init__ ([self ])
1339
1339
self .__name__ = name
1340
1340
self .__covariant__ = bool (covariant )
@@ -1850,7 +1850,7 @@ def _is_unpack(obj):
1850
1850
class TypeVarTuple (typing .TypeVarTuple , _DefaultMixin , _root = True ):
1851
1851
"""Type variable tuple."""
1852
1852
1853
- def __init__ (self , name , * , default = None ):
1853
+ def __init__ (self , name , * , default = _marker ):
1854
1854
super ().__init__ (name )
1855
1855
_DefaultMixin .__init__ (self , default )
1856
1856
@@ -1913,7 +1913,7 @@ def get_shape(self) -> Tuple[*Ts]:
1913
1913
def __iter__ (self ):
1914
1914
yield self .__unpacked__
1915
1915
1916
- def __init__ (self , name , * , default = None ):
1916
+ def __init__ (self , name , * , default = _marker ):
1917
1917
self .__name__ = name
1918
1918
_DefaultMixin .__init__ (self , default )
1919
1919
0 commit comments