inspect_type_links.second module

Second module

Classes

class Foo
A class in the second module
class FooSlots
A slot class
class FooSlotsInvalid
A slot class with an invalid annotation. Has to be separate because otherwise it would invalidate all other slot annotations in FooSlots as well.

Enums

class Enum(enum.Enum): FIRST = 1 SECOND = 2
An enum

Functions

def returns_none(a: typing.Callable[[], None]) -> None
In order to disambiguate between a missing return annotation and an annotated none, the None return annotation is kept, converted from NoneType to None
def returns_none_type(a: typing.Callable[[], None]) -> None
And it should behave the same when using None or type(None)
Annotation linking to a type that's a part of INPUT_MODULES but not known
def type_default_values(a: Enum = Enum.SECOND, b: typing.Tuple[Foo] = (<class 'inspect_type_links.second.Foo'>,), c: Foo = …)
A function with default values, one enum, one tuple and the third nonrepresentable (yes, the tuple looks ugly)
def type_enum(a: Enum)
Function referencing an enum
def type_nested(a: typing.Tuple[Foo, typing.List[Enum], typing.Any])
A function with nested type annotation
def type_nested_string(a: typing.Tuple[Foo, typing.List[Enum], typing.Any])
A function with nested string type annotation
def type_nested_string_invalid(a: typing.Tuple[FooBar, List[Enum], Any])
A function with invalid nested string type annotation
def type_return() -> Foo
A function with a return type annotation
def type_return_string_invalid(a: Foo) -> FooBar
A function with invalid return string type annotation
def type_return_string_nested() -> typing.Tuple[Foo, typing.List[Enum], typing.Any]
A function with a string nested return type
def type_string(a: Foo)
A function with string type annotation
def type_string_invalid(a: Foo.Bar)
A function with invalid string type annotation
def type_string_nested(a: typing.Tuple[Foo, typing.List[Enum], typing.Any])
A function with string nested type annotation

Data

TYPE_DATA: Foo
TYPE_DATA_ENUM: Enum = Enum.SECOND
TYPE_DATA_STRING_NESTED: typing.Tuple[Foo, typing.List[Enum], typing.Any] = {}