@@ -13,12 +13,19 @@ class ExtensionFieldV3(TypedDict, extra_items=object): # type: ignore[call-arg]
1313 Required shape of any extension field on a v3 metadata document.
1414
1515 The Zarr v3 spec permits extra keys on array and group metadata
16- documents, provided each value is an object with `must_understand`
17- set to `False`. This TypedDict captures that constraint and is used
18- as the `extra_items=` parameter on `ArrayMetadataV3` and `GroupMetadataV3`.
16+ documents, provided each value is an object with a `must_understand`
17+ boolean key. This TypedDict captures that constraint and is used as
18+ the `extra_items=` parameter on `ArrayMetadataV3` and `GroupMetadataV3`.
19+
20+ `must_understand` is typed as `bool` rather than `Literal[False]` so
21+ that applications which understand a particular extension can produce
22+ or consume it with `must_understand: true` (signalling that readers
23+ that don't recognize the extension MUST refuse to open the document).
24+ The common case is still `false`, signalling that unknown readers may
25+ safely ignore the field.
1926
2027 Spec interpretation: this type follows the original Zarr v3.0 reading
21- of the spec, under which any object with `must_understand: false` is a
28+ of the spec, under which any object with a `must_understand` key is a
2229 valid extension field. The v3.1 spec rewrite added language requiring
2330 extension fields to also include a `name: str` key (the "Extension
2431 definition" form). Under the strict v3.1 reading, real-world extension
@@ -30,7 +37,7 @@ class ExtensionFieldV3(TypedDict, extra_items=object): # type: ignore[call-arg]
3037 ongoing discussion.
3138 """
3239
33- must_understand : Literal [ False ]
40+ must_understand : bool
3441
3542
3643class ArrayMetadataV3 (TypedDict , extra_items = ExtensionFieldV3 ): # type: ignore[call-arg]
0 commit comments