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

Function unparse_spec

Tools/i18n/pygettext.py:379–390  ·  view source on GitHub ↗

Unparse a keyword spec dictionary into a string.

(name, spec)

Source from the content-addressed store, hash-verified

377
378
379def unparse_spec(name, spec):
380 """Unparse a keyword spec dictionary into a string."""
381 if spec == {'msgid': 0}:
382 return name
383
384 parts = []
385 for arg, pos in sorted(spec.items(), key=lambda x: x[1]):
386 if arg == 'msgctxt':
387 parts.append(f'{pos + 1}c')
388 else:
389 parts.append(str(pos + 1))
390 return f'{name}:{','.join(parts)}'
391
392
393def process_keywords(keywords, *, no_default_keywords):

Callers 2

_extract_messageMethod · 0.85

Calls 4

strFunction · 0.85
itemsMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…