MCPcopy Create free account
hub / github.com/numpy/numpy / _fix_names

Function _fix_names

numpy/core/_internal.py:801–814  ·  view source on GitHub ↗

Replace names which are None with the next unused f%d name

(field_spec)

Source from the content-addressed store, hash-verified

799 return ret, common_alignment
800
801def _fix_names(field_spec):
802 """ Replace names which are None with the next unused f%d name """
803 names = field_spec['names']
804 for i, name in enumerate(names):
805 if name is not None:
806 continue
807
808 j = 0
809 while True:
810 name = f'f{j}'
811 if name not in names:
812 break
813 j = j + 1
814 names[i] = name
815
816def _add_trailing_padding(value, padding):
817 """Inject the specified number of padding bytes at the end of a dtype"""

Callers 1

__dtype_from_pep3118Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected