File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -103,20 +103,23 @@ def array(
103103 )
104104
105105
106+ Block = dict [str , Attribute ]
107+
108+
106109def blocks (cls ) -> list [list [Attribute ]]:
107110 """Return an ordered list of blocks for a component class."""
108111 return [list (v .values ()) for v in blocks_dict (cls ).values ()]
109112
110113
111- def blocks_dict (cls ) -> dict [str , Attribute ]:
114+ def blocks_dict (cls ) -> dict [str , Block ]:
112115 """
113116 Return an ordered dictionary of blocks for a component class,
114117 whose keys are block names. Each block is a map from variable
115118 (field) name to `attrs.Attribute`.
116119 """
117120 fields = fields_dict (cls )
118121 fields = {k : v for k , v in fields .items () if "block" in v .metadata }
119- blocks = {}
122+ blocks : dict [ str , Block ] = {}
120123 for k , v in fields .items ():
121124 block = v .metadata ["block" ]
122125 if block not in blocks :
You can’t perform that action at this time.
0 commit comments