schrodinger.utils.typing module

File that defines custom typing classes for use in the schrodinger package.

A note on abstract base classes

Some types in here are defined as a subclass of abc.ABC. Such classes will be a virtual base class of any type that implements the abstract methods defined. Thus the Appendable class is a virtual base class for the builtin list type because list implements an append method:

from schrodinger.utils.typing import Appendable

assert isinstance([], Appendable)
assert issubclass(list, Appendable)
assert not issubclass(tuple, Appendable)

For more information, read https://docs.python.org/3/library/abc.html and https://peps.python.org/pep-3119/

class schrodinger.utils.typing.Appendable

Bases: abc.ABC

Abstract base class for any class that implements an append method.

abstract append(item)
class schrodinger.utils.typing.Extendable

Bases: abc.ABC

Abstract base class for any class that implements an extend method.

abstract extend(iterable)