Argument#

class src.pyconverter.xml2py.ast_tree.Argument(element: str | Element, initial_argument: List, description: Element | str | None = None)#

Argument object.

Overview#

rec_find

Find the first type matching a given type string recursively.

str_types

String representation of the parameter types.

resized_description

Resize the description to a maximum length.

to_py_docstring

Return a list of string to enable converting the element to an RST format.

to_py_signature

Return the Python signature of the argument.

py_arg_name

Python-compatible term.

is_arg_elipsis

Check if the argument is an elipsis.

multiple_args

types

One or more parameter types.

Import detail#

from src.pyconverter.xml2py.ast_tree import Argument

Property detail#

property Argument.py_arg_name: str#

Python-compatible term.

property Argument.is_arg_elipsis#

Check if the argument is an elipsis.

Returns:
bool

True if the argument is an elipsis, False otherwise.

property Argument.multiple_args#
property Argument.types: List[type]#

One or more parameter types.

This is guessed from any subvarlists. If unavailable, then it’s guessed from the description of the variable.

This is either a string, float, or integer (or some combination thereof).

Method detail#

Argument.rec_find(_type: str, terms=None) Element | None#

Find the first type matching a given type string recursively.

Argument.str_types(join_str: str) str#

String representation of the parameter types.

Argument.resized_description(description: str | None = None, max_length: int = 100, indent: str = '') List[str]#

Resize the description to a maximum length.

Argument.to_py_docstring(max_length=100, indent='', links=None, base_url=None, fcache=None) List[str]#

Return a list of string to enable converting the element to an RST format.

Argument.to_py_signature() str#

Return the Python signature of the argument.