@@ -114,36 +114,37 @@ def _unparse_action(self, action: Action) -> None: # noqa: C901, PLR0912
114114 or self ._arg_is_default_and_help_is_suppressed (action )
115115 ):
116116 return
117- if action_type == "_AppendAction" :
118- self ._unparse_append_action (action )
119- elif action_type == "_AppendConstAction" :
120- self ._unparse_append_const_action (action )
121- elif action_type == "_CountAction" :
122- self ._unparse_count_action (action )
123- elif action_type == "_ExtendAction" :
124- self ._unparse_extend_action (action )
125- elif action_type == "_HelpAction" : # pragma: no cover
126- return
127- elif action_type == "_StoreAction" :
128- self ._unparse_store_action (action )
129- elif action_type == "_StoreConstAction" :
130- self ._unparse_store_const_action (action )
131- elif action_type == "_StoreFalseAction" :
132- self ._unparse_store_false_action (action )
133- elif action_type == "_StoreTrueAction" :
134- self ._unparse_store_true_action (action )
135- elif action_type == "_SubParsersAction" :
136- self ._unparse_sub_parsers_action (action )
137- elif action_type == "_VersionAction" : # pragma: no cover
138- return
139- elif action_type == "BooleanOptionalAction" :
140- self ._unparse_boolean_optional_action (action )
141- else : # pragma: no cover
142- message = (
143- f"{ self .__class__ .__name__ } does not yet support the "
144- f"unparsing of { action_type } objects."
145- )
146- raise NotImplementedError (message )
117+ match action_type :
118+ case "_AppendAction" :
119+ self ._unparse_append_action (action )
120+ case "_AppendConstAction" :
121+ self ._unparse_append_const_action (action )
122+ case "_CountAction" :
123+ self ._unparse_count_action (action )
124+ case "_ExtendAction" :
125+ self ._unparse_extend_action (action )
126+ case "_HelpAction" : # pragma: no cover
127+ return
128+ case "_StoreAction" :
129+ self ._unparse_store_action (action )
130+ case "_StoreConstAction" :
131+ self ._unparse_store_const_action (action )
132+ case "_StoreFalseAction" :
133+ self ._unparse_store_false_action (action )
134+ case "_StoreTrueAction" :
135+ self ._unparse_store_true_action (action )
136+ case "_SubParsersAction" :
137+ self ._unparse_sub_parsers_action (action )
138+ case "_VersionAction" : # pragma: no cover
139+ return
140+ case "BooleanOptionalAction" :
141+ self ._unparse_boolean_optional_action (action )
142+ case _: # pragma: no cover
143+ message = (
144+ f"{ self .__class__ .__name__ } does not yet support the "
145+ f"unparsing of { action_type } objects."
146+ )
147+ raise NotImplementedError (message )
147148
148149 def _arg_is_default_and_help_is_suppressed (self , action : Action ) -> bool :
149150 """
0 commit comments