<li>
Reference
<ul>
- <li><a href="#methods">Methods</a></li>
<li><a href="#properties">Properties</a></li>
</ul>
</li>
</ul>
</div>
- <section id="methods">
- <h2><a href="#methods">Methods</a></h2>
- <dl class="m-doc">
- <dt>
- <span class="m-doc-wrap-bumper">def <a href="#string_annotation" class="m-doc-self" id="string_annotation">string_annotation</a>(</span><span class="m-doc-wrap">self: <a href="inspect_annotations.Foo.html" class="m-doc">Foo</a>)</span>
- </dt>
- <dd>String annotations</dd>
- </dl>
- </section>
<section id="properties">
<h2><a href="#properties">Properties</a></h2>
<dl class="m-doc">
<h1>
inspect_annotations <span class="m-thin">module</span>
</h1>
+ <p>Annotation parsing. For links inside annotations see test_inspect.TypeLinks.</p>
<div class="m-block m-default">
<h3>Contents</h3>
<ul>
<dt>
<span class="m-doc-wrap-bumper">def <a href="#annotation" class="m-doc-self" id="annotation">annotation</a>(</span><span class="m-doc-wrap">param: typing.List[int],
another: bool,
- third: str = 'hello') -> <a href="inspect_annotations.Foo.html" class="m-doc">Foo</a></span>
+ third: str = 'hello') -> float</span>
</dt>
<dd>An annotated function</dd>
<dt>
<span class="m-doc-wrap-bumper">def <a href="#partial_annotation" class="m-doc-self" id="partial_annotation">partial_annotation</a>(</span><span class="m-doc-wrap">foo,
param: typing.Tuple[int, int],
unannotated,
- cls: <a href="inspect_annotations.Foo.html" class="m-doc">Foo</a>)</span>
+ cls: object)</span>
</dt>
<dd>Partially annotated function</dd>
<dt>
+"""Annotation parsing. For links inside annotations see test_inspect.TypeLinks."""
+
import sys
from typing import List, Tuple, Dict, Any, Union, Optional, Callable, TypeVar
"""A property with a type annotation"""
pass
- # Self-reference is only possible with a string in Py3
- # https://stackoverflow.com/a/33533514
- def string_annotation(self: 'Foo'):
- """String annotations"""
- pass
-
-def annotation(param: List[int], another: bool, third: str = "hello") -> Foo:
+def annotation(param: List[int], another: bool, third: str = "hello") -> float:
"""An annotated function"""
pass
"""Non-annotated function with a default parameter"""
pass
-def partial_annotation(foo, param: Tuple[int, int], unannotated, cls: Foo):
+def partial_annotation(foo, param: Tuple[int, int], unannotated, cls: object):
"""Partially annotated function"""
pass