Skip to content

Commit

Permalink
Add containing types to view object annotations and improve consisten…
Browse files Browse the repository at this point in the history
…cy in docs.
  • Loading branch information
knutnergaard committed Dec 3, 2024
1 parent 281f39b commit abdf8c2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Lib/fontParts/base/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,12 @@ def get(
"""
return super(BaseGroups, self).get(groupName, default)

def items(self) -> BaseItems:
"""View the key-value pairs in the current groups instance.
def items(self) -> BaseItems[Tuple[str, ValueType]]:
"""View the items in the current groups instance.
Each item is represented as a :class:`tuple` of key-value pairs, where:
- `key` is a :class:`str` representing a group name.
- `value` is a :class:`tuple` of :class:`str` glyph names.
:return: A :ref:`type-view` of the groups' ``(key, value)`` pairs.
Expand All @@ -429,9 +433,9 @@ def items(self) -> BaseItems:
return super(BaseGroups, self).items()

def keys(self) -> BaseKeys:
"""View the keys in the current groups instance.
"""View the group names (keys) in the current groups instance.
:return: A :ref:`type-view` of the groups' keys.
:return: A :ref:`type-view` of :class:`str` items representing the groups' keys.
Example::
Expand All @@ -444,7 +448,8 @@ def keys(self) -> BaseKeys:
def values(self) -> BaseValues:
"""View the values in the current groups instance.
:return: A :ref:`type-view` of the groups' values.
:return: A :ref:`type-view` of the groups' values as :class:`tuple`
items of :class:`str` glyph names.
Example::
Expand Down

0 comments on commit abdf8c2

Please sign in to comment.