@@ -267,7 +267,7 @@ def _restify_py36(cls: Optional[Type], mode: str = 'fully-qualified-except-typin
267
267
return reftext + '\\ [%s]' % param_str
268
268
else :
269
269
return reftext
270
- elif isinstance (cls , typing .GenericMeta ):
270
+ elif isinstance (cls , typing .GenericMeta ): # type: ignore[attr-defined]
271
271
if module == 'typing' :
272
272
reftext = ':py:class:`~typing.%s`' % qualname
273
273
else :
@@ -505,16 +505,16 @@ def _stringify_py36(annotation: Any, mode: str = 'fully-qualified-except-typing'
505
505
return '%s%s[%s]' % (modprefix , qualname , param_str )
506
506
else :
507
507
return modprefix + qualname
508
- elif isinstance (annotation , typing .GenericMeta ):
508
+ elif isinstance (annotation , typing .GenericMeta ): # type: ignore[attr-defined]
509
509
params = None
510
- if annotation .__args__ is None or len (annotation .__args__ ) <= 2 : # type: ignore # NOQA
511
- params = annotation .__args__ # type: ignore
512
- elif annotation .__origin__ == Generator : # type: ignore
513
- params = annotation .__args__ # type: ignore
510
+ if annotation .__args__ is None or len (annotation .__args__ ) <= 2 : # NOQA
511
+ params = annotation .__args__
512
+ elif annotation .__origin__ == Generator :
513
+ params = annotation .__args__
514
514
else : # typing.Callable
515
515
args = ', ' .join (stringify (arg , mode ) for arg
516
- in annotation .__args__ [:- 1 ]) # type: ignore
517
- result = stringify (annotation .__args__ [- 1 ]) # type: ignore
516
+ in annotation .__args__ [:- 1 ])
517
+ result = stringify (annotation .__args__ [- 1 ])
518
518
return '%s%s[[%s], %s]' % (modprefix , qualname , args , result )
519
519
if params is not None :
520
520
param_str = ', ' .join (stringify (p , mode ) for p in params )
0 commit comments