pyppin.base

[Browse Source]

Basic language extensions.

Modules

pyppin.base.cache

Caching decorators for functions and methods

pyppin.base.flex_decorator

A way to simplify writing Python decorators and improve their syntax.

pyppin.base.import_file

A function to import a Python file from its pathname.

pyppin.base.lazyinit

An instance method decorator to make initializers execute once, on demand.

pyppin.base.registered_class

Make it easy to look up subclasses of an abstract class by name.

Functions

assert_not_none(val)

Assert that a value is not None, to make mypy happy.

pyppin.base.assert_not_none(val: Optional[_T]) _T[source]

Assert that a value is not None, to make mypy happy.

This is useful when a function technically returns an Optional[Foo], but you know for other reasons that it’s never None. Wrapping the result in this assertion makes that statement explicit and thus makes mypy happy as well when you use its result as a Foo.