concepts.dsl.dsl_types.FormatContext#

class FormatContext[source]#

Bases: OptionContext

FormatContext is a context manager that controls the format of types and objects.

Methods

as_default()

Make this option context the current context.

get_default()

Get the current option context.

get_option(name)

Get the option value of the current context.

set_default_option(name, value)

Set the option value for the current context.

Attributes

current_context

default_context

type_format_cls

If True, the type will be formatted as Type[typename].

object_format_type

If True, the object format will include the type.

function_format_lambda

If True, the function format will be lambda-function styled.

expr_max_length

The maximum length of the expression per line.

type_varname_sep

The separator between the type and the variable name.

__init__(**init_kwargs)#
__new__(**kwargs)#
as_default()#

Make this option context the current context. It will overwrite the current option values.

classmethod get_default()#

Get the current option context.

classmethod get_option(name)#

Get the option value of the current context.

classmethod set_default_option(name, value)#

Set the option value for the current context.

current_context = <_thread._local object>#
default_context = <_thread._local object>#
expr_max_length: int#

The maximum length of the expression per line.

function_format_lambda: bool#

If True, the function format will be lambda-function styled. Otherwise, it will be python-function styled.

object_format_type: bool#

If True, the object format will include the type.

type_format_cls: bool#

If True, the type will be formatted as Type[typename].

type_varname_sep: str#

The separator between the type and the variable name.