ddtrace/pin.py
def clone(self, service=None, app=None, app_type=None, tags=None, tracer=None):
        """Return a clone of the pin with the given attributes replaced."""
        # do a shallow copy of Pin dicts
        if not tags and self.tags:
            tags = self.tags.copy()

        # we use a copy instead of a deepcopy because we expect configurations
        # to have only a root level dictionary without nested objects. Using
        # deepcopy introduces a big overhead:
        #
        # copy: 0.00654911994934082
        # deepcopy: 0.2787208557128906
        config = self._config.copy()

        return Pin(
            service=service or self.service,
            app=app or self.app,
            app_type=app_type or self.app_type,
            tags=tags,
            tracer=tracer or self.tracer,  # do not clone the Tracer
            _config=config,
        )
Return a clone of the pin with the given attributes replaced.
Return a clone of the pin with the given attributes replaced.
Return a clone of the pin with the given attributes replaced .
def clone(self, service=None, app=None, app_type=None, tags=None, tracer=None):
        if not tags and self.tags:
            tags = self.tags.copy()
         copy: 0.00654911994934082
         deepcopy: 0.2787208557128906
        config = self._config.copy()
        return Pin(
            service=service or self.service,
            app=app or self.app,
            app_type=app_type or self.app_type,
            tags=tags,
            tracer=tracer or self.tracer,   do not clone the Tracer
            _config=config,
        )
def clone ( self , service = None , app = None , app_type = None , tags = None , tracer = None ) : if not tags and self . tags : tags = self . tags . copy ( ) config = self . _config . copy ( ) return Pin ( service = service or self . service , app = app or self . app , app_type = app_type or self . app_type , tags = tags , tracer = tracer or self . tracer , _config = config , )
Return a clone of the pin with the given attributes replaced.
Return a clone of the pin with the given attributes replaced .
"""Return a clone of the pin with the given attributes replaced.""" # do a shallow copy of Pin dicts # we use a copy instead of a deepcopy because we expect configurations # to have only a root level dictionary without nested objects. Using # deepcopy introduces a big overhead: # # copy: 0.00654911994934082 # deepcopy: 0.2787208557128906 # do not clone the Tracer
self
service
app
app_type
tags
tracer