nested_type_links += [nested_type_link]
nested_return_type, nested_return_type_link = extract_annotation(state, referrer_path, args[-1])
+ # If nested parsing failed (the invalid annotation below),
+ # fail the whole thing
+ if None in nested_types or nested_return_type is None:
+ return None, None
+
return (
'{}[[{}], {}]'.format(name, ', '.join(nested_types), nested_return_type),
'{}[[{}], {}]'.format(name_link, ', '.join(nested_type_links), nested_return_type_link)
nested_types += [nested_type]
nested_type_links += [nested_type_link]
+ # If nested parsing failed (the invalid annotation below),
+ # fail the whole thing
+ if None in nested_types: return None, None
+
return (
'{}[{}]'.format(name, ', '.join(nested_types)),
'{}[{}]'.format(name_link, ', '.join(nested_type_links)),
<span class="m-doc-wrap-bumper">def <a href="#annotation_func_instead_of_type" class="m-doc-self">annotation_func_instead_of_type</a>(</span><span class="m-doc-wrap">a)</span>
</dt>
<dd>Annotation with a function instead of a type, ignored</dd>
+ <dt id="annotation_func_instead_of_type_nested">
+ <span class="m-doc-wrap-bumper">def <a href="#annotation_func_instead_of_type_nested" class="m-doc-self">annotation_func_instead_of_type_nested</a>(</span><span class="m-doc-wrap">a, b, c)</span>
+ </dt>
+ <dd>Annotations with nested problems, ignoring the whole thing</dd>
<dt id="annotation_generic">
<span class="m-doc-wrap-bumper">def <a href="#annotation_generic" class="m-doc-self">annotation_generic</a>(</span><span class="m-doc-wrap">a: typing.List[Tp]) -> Tp</span>
</dt>
def annotation_func_instead_of_type(a: open):
"""Annotation with a function instead of a type, ignored"""
+def annotation_func_instead_of_type_nested(a: List[open], b: Callable[[open], str], c: Callable[[str], open]):
+ """Annotations with nested problems, ignoring the whole thing"""
+
def annotation_any(a: Any):
"""Annotation with the Any type"""