@@ -1157,7 +1157,7 @@ def __init__(self, default):
11571157 if isinstance (default , (tuple , list )):
11581158 self .__default__ = tuple ((typing ._type_check (d , "Default must be a type" )
11591159 for d in default ))
1160- elif default :
1160+ elif default != _marker :
11611161 self .__default__ = typing ._type_check (default , "Default must be a type" )
11621162 else :
11631163 self .__default__ = None
@@ -1171,7 +1171,7 @@ class TypeVar(typing.TypeVar, _DefaultMixin, _root=True):
11711171
11721172 def __init__ (self , name , * constraints , bound = None ,
11731173 covariant = False , contravariant = False ,
1174- default = None , infer_variance = False ):
1174+ default = _marker , infer_variance = False ):
11751175 super ().__init__ (name , * constraints , bound = bound , covariant = covariant ,
11761176 contravariant = contravariant )
11771177 _DefaultMixin .__init__ (self , default )
@@ -1258,7 +1258,7 @@ class ParamSpec(typing.ParamSpec, _DefaultMixin, _root=True):
12581258 __module__ = 'typing'
12591259
12601260 def __init__ (self , name , * , bound = None , covariant = False , contravariant = False ,
1261- default = None ):
1261+ default = _marker ):
12621262 super ().__init__ (name , bound = bound , covariant = covariant ,
12631263 contravariant = contravariant )
12641264 _DefaultMixin .__init__ (self , default )
@@ -1334,7 +1334,7 @@ def kwargs(self):
13341334 return ParamSpecKwargs (self )
13351335
13361336 def __init__ (self , name , * , bound = None , covariant = False , contravariant = False ,
1337- default = None ):
1337+ default = _marker ):
13381338 super ().__init__ ([self ])
13391339 self .__name__ = name
13401340 self .__covariant__ = bool (covariant )
@@ -1850,7 +1850,7 @@ def _is_unpack(obj):
18501850 class TypeVarTuple (typing .TypeVarTuple , _DefaultMixin , _root = True ):
18511851 """Type variable tuple."""
18521852
1853- def __init__ (self , name , * , default = None ):
1853+ def __init__ (self , name , * , default = _marker ):
18541854 super ().__init__ (name )
18551855 _DefaultMixin .__init__ (self , default )
18561856
@@ -1913,7 +1913,7 @@ def get_shape(self) -> Tuple[*Ts]:
19131913 def __iter__ (self ):
19141914 yield self .__unpacked__
19151915
1916- def __init__ (self , name , * , default = None ):
1916+ def __init__ (self , name , * , default = _marker ):
19171917 self .__name__ = name
19181918 _DefaultMixin .__init__ (self , default )
19191919
0 commit comments