Skip to content
Roboto
Esc
↑↓navigate↵open⌘Jpreview
On this page

roboto.warnings

Module Contents

ExperimentalWarning

exception roboto.warnings.ExperimentalWarning#View Source

Bases: Warning

Warning category for experimental APIs.

experimental()

roboto.warnings.experimental(target: _C, /) → _C#View Source
roboto.warnings.experimental(target: _F, /) → _F
roboto.warnings.experimental(target: str, /) → Callable[[_T], _T]
roboto.warnings.experimental(*, message: str) → Callable[[_T], _T]

Mark a class, function, or method as experimental.

Experimental APIs may be incomplete, subject to change, or removed without notice.

Prepends a .. warning:: notice to the target’s docstring, so documentation rendered from it and help() show the target as experimental, then returns the target itself.

Can be used in three ways:

@experimental
def my_function(): ...


@experimental("Custom message about this API.")
def my_function(): ...


@experimental(message="Custom message about this API.")
def my_function(): ...

Parameters

target

The object to mark when applied as @experimental, or the notice text when called as @experimental("...").

message

The notice text. Defaults to “<qualified name of the target> is experimental and may change or be removed without notice.”

Raises

TypeError

The target is not callable, as when the decorator is placed above @property or @classmethod and not below it.

roboto_default_warning_behavior()

roboto.warnings.roboto_default_warning_behavior()#View Source

Was this page helpful?