-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Our README says that GroupedMetadata should be handled by iterating over the object and treating the results as if they had been "unpacked" in the Annotated type. However, the docstring is specific to BaseMetadata, as is the type annotation:
annotated-types/annotated_types/__init__.py
Lines 154 to 158 in 99dbac8
| """A grouping of multiple BaseMetadata objects. | |
| `GroupedMetadata` on its own is not metadata and has no meaning. | |
| All of the constraints and metadata should be fully expressable | |
| in terms of the `BaseMetadata`'s returned by `GroupedMetadata.__iter__()`. |
annotated-types/annotated_types/__init__.py
Lines 188 to 189 in 99dbac8
| def __iter__(self) -> Iterator[BaseMetadata]: | |
| ... |
The README is correct here, since we want to match typing.Unpack, so we should update the docstring to describe it as 'a grouping of multiple objects, like typing.Unpack', and annotate the iterable as containing object.
(originally identified in this downstream issue: HypothesisWorks/hypothesis#3986 (comment))