base.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:AshsSDK 作者: thehappydinoa 项目源码 文件源码
def clone(self, value=noValue, **kwargs):
        """Create a copy of a |ASN.1| type or object.

          Any parameters to the *clone()* method will replace corresponding
          properties of the |ASN.1| object.

          Parameters
          ----------
          value: :class:`tuple`, :class:`str` or |ASN.1| object
              Initialization value to pass to new ASN.1 object instead of
              inheriting one from the caller.

          tagSet: :py:class:`~pyasn1.type.tag.TagSet`
              Object representing ASN.1 tag(s) to use in new object instead of inheriting from the caller

          subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection`
              Object representing ASN.1 subtype constraint(s) to use in new object instead of inheriting from the caller

          Returns
          -------
          :
              new instance of |ASN.1| type/value
        """
        if value is None or value is noValue:
            if not kwargs:
                return self

            value = self._value

        for arg in self.readOnly:
            if arg not in kwargs:
                kwargs[arg] = getattr(self, arg)

        return self.__class__(value, **kwargs)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号