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

Function _tuple_str

Lib/dataclasses.py:424–433  ·  view source on GitHub ↗
(obj_name, fields)

Source from the content-addressed store, hash-verified

422
423
424def _tuple_str(obj_name, fields):
425 # Return a string representing each field of obj_name as a tuple
426 # member. So, if fields is ['x', 'y'] and obj_name is "self",
427 # return "(self.x,self.y)".
428
429 # Special case for the 0-tuple.
430 if not fields:
431 return '()'
432 # Note the trailing comma, needed if this turns out to be a 1-tuple.
433 return f'({",".join([f"{obj_name}.{f.name}" for f in fields])},)'
434
435
436class _FuncBuilder:

Callers 2

_hash_addFunction · 0.85
_process_classFunction · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…