MCPcopy Create free account
hub / github.com/python/cpython / parse_argument

Method parse_argument

Tools/clinic/libclinic/converter.py:365–380  ·  view source on GitHub ↗
(self, args: list[str])

Source from the content-addressed store, hash-verified

363 # For "positional-only" function parsing,
364 # which generates a bunch of PyArg_ParseTuple calls.
365 def parse_argument(self, args: list[str]) -> None:
366 assert not (self.converter and self.encoding)
367 if self.format_unit == 'O&':
368 assert self.converter
369 args.append(self.converter)
370
371 if self.encoding:
372 args.append(libclinic.c_str_repr(self.encoding))
373 elif self.subclass_of:
374 args.append(self.subclass_of)
375
376 s = ("&" if self.parse_by_reference else "") + self.parser_name
377 args.append(s)
378
379 if self.length:
380 args.append(f"&{self.length_name}")
381
382 #
383 # All the functions after here are intended as extension points.

Callers 2

_render_non_selfMethod · 0.95

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected