gemseo / core / grammars

Hide inherited members

required_names module

Grammar required names.

class gemseo.core.grammars.required_names.RequiredNames(grammar, names=())[source]

Bases: MutableSet[str]

A set-like class for handling grammar required names.

The names in an instance of this class shall belong to the bound grammar.

Parameters:
  • grammar (BaseGrammar) – The grammar bound to the required names.

  • names (Iterable[str]) –

    The required names.

    By default it is set to ().

add(name)[source]

Add an element.

Parameters:

name (str) –

Return type:

None

clear()

This is slow (creates N new iterators!) but effective.

discard(name)[source]

Remove an element. Do not raise an exception if absent.

Parameters:

name (str) –

Return type:

None

isdisjoint(other)

Return True if two sets have a null intersection.

pop()

Return the popped value. Raise KeyError if empty.

remove(value)

Remove an element. If not a member, raise a KeyError.