InlineAnnotation

class tket.metadata.InlineAnnotation(*args, **kwargs)[source]

Bases: Metadata[Literal[‘never’] | Literal[‘best_effort’]]

Metadata hinting the compiler that a function declaration should be inlined at its call sites.

When a function is not annotated, we use a heuristic to determine whether to inline.

Values: - “never”: Never inline this function. - “best_effort”:

Inline the function if possible. This is not guaranteed, the compiler may choose not to inline functions with this annotation.

ALIASES: ClassVar[list[str]] = []

Other aliases of the metadata key.

Typed metadata reads use these, in order, as fallbacks when KEY is not present. This is used for backward compatibility when renaming metadata keys.

Writes ignore this field and only write to KEY.

KEY: ClassVar[str] = 'tket.inline'

The unique key associated with the metadata entry.

__init__(*args, **kwargs)
classmethod from_json(value)[source]

Deserialize the metadata value from the stored json value.

Return type:

Union[Literal['never'], Literal['best_effort']]

classmethod to_json(value)[source]

Serialize the metadata value to a json value.

Return type:

str | int | float | bool | None | Mapping[str, JsonType] | list[JsonType]