File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -2210,12 +2210,20 @@ def is_star(self) -> bool:
22102210@mypyc_attr (native_class = False )
22112211class ArgKinds (list [ArgKind ]):
22122212 def __init__ (self , values : Iterable [ArgKind ] = None ) -> None :
2213+ if values is None :
2214+ super ().__init__ ()
2215+ else :
2216+ super ().__init__ (values )
22132217 self .__count_cache : dict [ArgKind , int ] = {}
22142218 self .__index_cache : dict [ArgKind , int ] = {}
2219+ self .__positional_only : bool | None = None
22152220
22162221 @property
22172222 def positional_only (self ) -> bool :
2218- return all (kind == ARG_POS for kind in self )
2223+ pos_only = self .__positional_only
2224+ if pos_only is None :
2225+ pos_only = self .__positional_only = all (kind == ARG_POS for kind in self )
2226+ return pos_only
22192227
22202228 @property
22212229 def has_star (self ) -> bool :
You can’t perform that action at this time.
0 commit comments