MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / clone

Method clone

pager_lib/pyasn1/type/base.py:347–372  ·  view source on GitHub ↗

Create a modified version of |ASN.1| schema or value object. The `clone()` method accepts the same set arguments as |ASN.1| class takes on instantiation except that all arguments of the `clone()` method are optional. Whatever arguments are supplied, they are used to

(self, value=noValue, **kwargs)

Source from the content-addressed store, hash-verified

345 return self._value is not noValue
346
347 def clone(self, value=noValue, **kwargs):
348 """Create a modified version of |ASN.1| schema or value object.
349
350 The `clone()` method accepts the same set arguments as |ASN.1|
351 class takes on instantiation except that all arguments
352 of the `clone()` method are optional.
353
354 Whatever arguments are supplied, they are used to create a copy
355 of `self` taking precedence over the ones used to instantiate `self`.
356
357 Note
358 ----
359 Due to the immutable nature of the |ASN.1| object, if no arguments
360 are supplied, no new |ASN.1| object will be created and `self` will
361 be returned instead.
362 """
363 if value is noValue:
364 if not kwargs:
365 return self
366
367 value = self._value
368
369 initializers = self.readOnly.copy()
370 initializers.update(kwargs)
371
372 return self.__class__(value, **initializers)
373
374 def subtype(self, value=noValue, **kwargs):
375 """Create a specialization of |ASN.1| schema or value object.

Callers 15

_createComponentMethod · 0.45
valueDecoderMethod · 0.45
indefLenValueDecoderMethod · 0.45
valueDecoderMethod · 0.45
indefLenValueDecoderMethod · 0.45
encodeValueMethod · 0.45
encodeValueMethod · 0.45
encodeValueMethod · 0.45
encodeValueMethod · 0.45
encodeValueMethod · 0.45
encodeValueMethod · 0.45

Calls 2

copyMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected