ListOf

(class from pyomo.common.config)

class pyomo.common.config.ListOf(itemtype=None, domain=None, string_lexer=NOTSET)[source]

Bases: _Container

Domain validator for lists of a specified type

Incoming values are converted using the domain callable (if not set / None, then the itemtype is used as the domain). If the incoming value is iterable and not an instance of itemtype, then the incoming value is iterated over to generate individual entries in the list.

Parameters:
  • itemtype (type) – The type for each element in the list

  • domain (Callable) – A domain validator (callable that takes the incoming value, validates it, and returns the appropriate domain type) for each element in the list. If not specified, defaults to the itemtype.

  • string_lexer (Callable) – A preprocessor (lexer) called for all string values. If NOTSET, then strings are split on whitespace and/or commas (honoring simple use of single or double quotes). If None, then no tokenization is performed.

__init__(itemtype=None, domain=None, string_lexer=NOTSET)

Methods

__init__([itemtype, domain, string_lexer])

domain_name()

Member Documentation

ReturnType

alias of list