MCPcopy Create free account
hub / github.com/celery/celery / seq_concat_item

Function seq_concat_item

celery/utils/functional.py:476–483  ·  view source on GitHub ↗

Return copy of sequence seq with item added. Returns: Sequence: if seq is a tuple, the result will be a tuple, otherwise it depends on the implementation of ``__add__``.

(seq, item)

Source from the content-addressed store, hash-verified

474
475
476def seq_concat_item(seq, item):
477 """Return copy of sequence seq with item added.
478
479 Returns:
480 Sequence: if seq is a tuple, the result will be a tuple,
481 otherwise it depends on the implementation of ``__add__``.
482 """
483 return seq + (item,) if isinstance(seq, tuple) else seq + [item]
484
485
486def seq_concat_seq(a, b):

Callers 2

test_seq_concat_itemFunction · 0.90
__or__Method · 0.90

Calls

no outgoing calls

Tested by 1

test_seq_concat_itemFunction · 0.72