MCPcopy Index your code
hub / github.com/faust-streaming/faust / obj_attrs_tuple

Function obj_attrs_tuple

faust/utils/codegen.py:234–242  ·  view source on GitHub ↗

Draw Python tuple from list of attributes. If attrs is ``['x', 'y']`` and ``obj_name`` is 'self', returns ``(self.x,self.y)``.

(obj_name: str, attrs: List[str])

Source from the content-addressed store, hash-verified

232
233
234def obj_attrs_tuple(obj_name: str, attrs: List[str]) -> str:
235 """Draw Python tuple from list of attributes.
236
237 If attrs is ``['x', 'y']`` and ``obj_name`` is 'self',
238 returns ``(self.x,self.y)``.
239 """
240 if not attrs:
241 return "()"
242 return f'({",".join([f"{obj_name}.{f}" for f in attrs])},)'
243
244
245def reprkwargs(

Callers 2

HashMethodFunction · 0.85
CompareMethodFunction · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected