MCPcopy Index your code
hub / github.com/python/cpython / parse_args

Method parse_args

Tools/clinic/libclinic/parse_args.py:968–1003  ·  view source on GitHub ↗
(self, clang: CLanguage)

Source from the content-addressed store, hash-verified

966 return d2
967
968 def parse_args(self, clang: CLanguage) -> dict[str, str]:
969 self.select_prototypes()
970 self.init_limited_capi()
971
972 self.flags = ""
973 self.declarations = ""
974 self.parser_prototype = ""
975 self.parser_definition = ""
976 self.impl_prototype = None
977 self.impl_definition = IMPL_DEFINITION_PROTOTYPE
978
979 # parser_body_fields remembers the fields passed in to the
980 # previous call to parser_body. this is used for an awful hack.
981 self.parser_body_fields: tuple[str, ...] = ()
982
983 if not self.parameters and not self.varpos and not self.var_keyword:
984 self.parse_no_args()
985 elif self.use_meth_o():
986 self.parse_one_arg()
987 elif self.has_option_groups():
988 self.parse_option_groups()
989 elif self.var_keyword is not None:
990 self.parse_var_keyword()
991 elif (not self.requires_defining_class
992 and self.pos_only == len(self.parameters)):
993 self.parse_pos_only()
994 else:
995 self.parse_general(clang)
996
997 self.copy_includes()
998 if self.is_new_or_init():
999 self.handle_new_or_init()
1000 self.process_methoddef(clang)
1001 self.finalize(clang)
1002
1003 return self.create_template_dict()

Calls 15

select_prototypesMethod · 0.95
init_limited_capiMethod · 0.95
parse_no_argsMethod · 0.95
use_meth_oMethod · 0.95
parse_one_argMethod · 0.95
has_option_groupsMethod · 0.95
parse_option_groupsMethod · 0.95
parse_var_keywordMethod · 0.95
parse_pos_onlyMethod · 0.95
parse_generalMethod · 0.95
copy_includesMethod · 0.95
is_new_or_initMethod · 0.95

Tested by 1

mainFunction · 0.36