MCPcopy
hub / github.com/celery/celery / clone

Method clone

celery/canvas.py:444–468  ·  view source on GitHub ↗

Create a copy of this signature. Arguments: args (Tuple): Partial args to be prepended to the existing args. kwargs (Dict): Partial kwargs to be merged with existing kwargs. options (Dict): Partial options to be merged with existing option

(self, args=None, kwargs=None, **opts)

Source from the content-addressed store, hash-verified

442 new_options)
443
444 def clone(self, args=None, kwargs=None, **opts):
445 """Create a copy of this signature.
446
447 Arguments:
448 args (Tuple): Partial args to be prepended to the existing args.
449 kwargs (Dict): Partial kwargs to be merged with existing kwargs.
450 options (Dict): Partial options to be merged with
451 existing options.
452 """
453 args = args if args else ()
454 kwargs = kwargs if kwargs else {}
455 # need to deepcopy options so origins links etc. is not modified.
456 if args or kwargs or opts:
457 args, kwargs, opts = self._merge(args, kwargs, opts)
458 else:
459 args, kwargs, opts = self.args, self.kwargs, self.options
460 signature = Signature.from_dict({'task': self.task,
461 'args': tuple(args),
462 'kwargs': kwargs,
463 'options': deepcopy(opts),
464 'subtask_type': self.subtask_type,
465 'immutable': self.immutable},
466 app=self._app)
467 signature._type = self._type
468 return signature
469
470 partial = clone
471

Callers 2

replaceMethod · 0.95
electionMethod · 0.95

Calls 2

_mergeMethod · 0.95
from_dictMethod · 0.45

Tested by

no test coverage detected