Example

There is a CLI interface typin/src/typin/typin_cli.py to execute arbitrary python code using compile() and exec() like this:

python typin_cli.py --stubs=stubs -- example.py 'foo bar baz'

This will compile()/exec() example.py with the arguments foo bar baz and dump out the results. These include the docstrings for the functions in example.py which have been inserted in that source code to produce this:

example.py

class typin.example.BaseClass[source]

Example base class to explore inheritance.

class typin.example.ExampleClass(first_name, last_name)[source]

An example class with a couple of methods that we exercise.

name()[source]

Returns the last name, first name.

Returns:str – Formatted name.
class typin.example.InnerClass(value)[source]

Same named inner class to explore inner/outer namespaces.

value()[source]

Returns the value.

Returns:bytes – The value.
class typin.example.MyNT(a, b, c)
a

Alias for field number 0

b

Alias for field number 1

c

Alias for field number 2

class typin.example.OuterClass(value)[source]

Example outer class to explore inner/outer issues.

class InnerClass(value)[source]

Example inner class to explore inner/outer issues.

value()[source]

Returns the value.

Returns:str – The value.
value()[source]

Returns the value.

Returns:str – The value.
typin.example.example_function(x)[source]

Example function.

Parameters:x (int) – Example argument.
Returns:int – Doubles the argument.
typin.example.main()[source]

Main entry point.

Returns:int – status code, 0 is success.