MCPcopy
hub / github.com/celery/celery / seq_concat_item

Function seq_concat_item

celery/utils/functional.py:419–426  ·  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

417
418
419def seq_concat_item(seq, item):
420 """Return copy of sequence seq with item added.
421
422 Returns:
423 Sequence: if seq is a tuple, the result will be a tuple,
424 otherwise it depends on the implementation of ``__add__``.
425 """
426 return seq + (item,) if isinstance(seq, tuple) else seq + [item]
427
428
429def 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