Groups

Must Override

BaseGroups._contains(key: KeyType) bool

Check if a key is in the native object.

This is the environment implementation of BaseDict.__contains__.

Parameters:

key – The key to check for. If a :cvar:`BaseDict.keyNormalizer` is set, it will have been applied to the key before checking.

Raises:

NotImplementedError – If the method has not been overridden by a subclass.

Important

Subclasses must override this method.

BaseGroups._delItem(key: KeyType) None

Delete a key-value pair from the native object.

This is the environment implementation of BaseDict.__delitem__.

Parameters:

key – The key to delete. If a :cvar:`BaseDict.keyNormalizer` is set, it will have been applied to the given key.

Raises:

NotImplementedError – If the method has not been overridden by a subclass.

Important

Subclasses must override this method.

BaseGroups._getItem(key: KeyType) ValueType

Get the value for a given key from the native object.

This is the environment implementation of BaseDict.__getitem__.

Parameters:

key – The key to retrieve the value for. If a :cvar:`BaseDict.keyNormalizer` is set, it will have been applied to the key in the calling method.

Returns:

The value for the given key. If a :cvar:`BaseDict.valueNormalizer` is set, it will be applied in the calling method to the returned value.

Raises:

NotImplementedError – If the method has not been overridden by a subclass.

Important

Subclasses must override this method.

BaseGroups._items() ItemsView[KeyType, ValueType]

Return a view of the key-value pairs in the native object.

This is the environment implementation of BaseDict.items.

Returns:

A ItemsView object instance. If both :cvar:`BaseDict.keyNormalizer` and :cvar:`BaseDict.valueNormalizer` are set, they will be applied to each key and value in the returned object.

Raises:

NotImplementedError – If the method has not been overridden by a subclass.

Important

Subclasses must override this method.

BaseGroups._setItem(key: KeyType, value: ValueType) None

Set the value for a given key in the native object.

This is the environment implementation of BaseDict.__setitem__.

Parameters:
Raises:

NotImplementedError – If the method has not been overridden by a subclass.

Important

Subclasses must override this method.

May Override

BaseGroups._clear() None

Remove all items from the native object.

This is the environment implementation of BaseDict.clear.

Note

Subclasses may override this method.

BaseGroups._findGlyph(glyphName: str) list[str][source]

Retrieve the groups associated with the given native glyph.

This is the environment implementation of BaseGroups.findGlyph.

Parameters:

glyphName – The name of the glyph to search for as a str. The value will have been normalized with normalizers.normalizeGlyphName.

Returns:

A list of str items.

Note

Subclasses may override this method.

BaseGroups._get(key: KeyType, default: ValueType | None) ValueType | None

Get the value for a given key in the native object.

This is the environment implementation of BaseDict.get.

Parameters:
  • key – The key to look up. If a :cvar:`BaseDict.keyNormalizer` is set, it will have been applied to the given key.

  • default – The default value to return if the key is not found.

Returns:

The value associated with the given key, or the default value if the key is not found. If a :cvar:`BaseDict.valueNormalizer` is set, it will be applied in the calling method to the returned value.

Note

Subclasses may override this method.

BaseGroups._init(*args: Any, **kwargs: Any) None

Initialize the native object.

This is the environment implementation of BaseObject.__init__.

Parameters:
  • *args – Any positional arguments.

  • **kwargs – Any keyword arguments.

Note

Subclasses may override this method.

BaseGroups._iter() Iterator[KeyType]

Return an iterator over the keys of the native object.

This is the environment implementation of BaseDict.__iter__.

Returns:

An iterator over the object’s keys.

Note

Subclasses may override this method.

BaseGroups._keys() BaseKeys[KeyType]

Return a view of the keys in the native object.

This is the environment implementation of BaseDict.keys.

Returns:

A BaseKeys object instance of str items. If a :cvar:`BaseDict.keyNormalizer` is set, it will be applied to each key in the returned view.

Note

Subclasses may override this method.

BaseGroups._len() int

Return the number of items in the native object.

This is the environment implementation of BaseDict.__len__.

Returns:

An int representing the number of dictionary items.

Note

Subclasses may override this method.

BaseGroups._pop(key: KeyType, default: ValueType | None) ValueType | None

Remove a key from the native object and return it’s value.

This is the environment implementation of BaseDict.pop.

Parameters:
  • key – The key to remove. If a :cvar:`BaseDict.keyNormalizer` is set, it will have been applied to the given key.

  • default – The default value to return if the key is not found.

Returns:

The value associated with the given key, or the default value if the key is not found. If a :cvar:`BaseDict.valueNormalizer` is set, it will be applied in the calling method to the returned value.

Note

Subclasses may override this method.

BaseGroups._update(other: MutableMapping[KeyType, ValueType]) None

Update the current native object instance with key-value pairs from another.

This is the environment implementation of BaseDict.update.

Parameters:

other – A MutableMapping of key-value pairs to update this dictionary with. If both :cvar:`BaseDict.keyNormalizer` and :cvar:`BaseDict.valueNormalizer` are set, they will have been applied to the keys and values, respectively.

Note

Subclasses may override this method.

BaseGroups._values() BaseValues[ValueType]

Return a view of the values in the native object.

This is the environment implementation of BaseDict.values.

Returns:

A BaseValues object instance. If a :cvar:`BaseDict.valueNormalizer` is set, it will be applied to each value in the returned view.

Note

Subclasses may override this method.