MCPcopy
hub / github.com/fluentpython/example-code-2e / parse_identifiers

Function parse_identifiers

24-class-metaprog/factories.py:67–72  ·  view source on GitHub ↗
(names: FieldNames)

Source from the content-addressed store, hash-verified

65
66
67def parse_identifiers(names: FieldNames) -> tuple[str, ...]:
68 if isinstance(names, str):
69 names = names.replace(',', ' ').split() # <9>
70 if not all(s.isidentifier() for s in names):
71 raise ValueError('names must all be valid identifiers')
72 return tuple(names)
73# end::RECORD_FACTORY[]

Callers 1

record_factoryFunction · 0.70

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected