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

Method isSameTypeWith

pager_lib/pyasn1/type/base.py:87–109  ·  view source on GitHub ↗

Examine |ASN.1| type for equality with other ASN.1 type. ASN.1 tags (:py:mod:`~pyasn1.type.tag`) and constraints (:py:mod:`~pyasn1.type.constraint`) are examined when carrying out ASN.1 types comparison. Python class inheritance relationship is NOT considered.

(self, other, matchTags=True, matchConstraints=True)

Source from the content-addressed store, hash-verified

85 return tagmap.TagMap({self.tagSet: self})
86
87 def isSameTypeWith(self, other, matchTags=True, matchConstraints=True):
88 """Examine |ASN.1| type for equality with other ASN.1 type.
89
90 ASN.1 tags (:py:mod:`~pyasn1.type.tag`) and constraints
91 (:py:mod:`~pyasn1.type.constraint`) are examined when carrying
92 out ASN.1 types comparison.
93
94 Python class inheritance relationship is NOT considered.
95
96 Parameters
97 ----------
98 other: a pyasn1 type object
99 Class instance representing ASN.1 type.
100
101 Returns
102 -------
103 : :class:`bool`
104 :obj:`True` if *other* is |ASN.1| type,
105 :obj:`False` otherwise.
106 """
107 return (self is other or
108 (not matchTags or self.tagSet == other.tagSet) and
109 (not matchConstraints or self.subtypeSpec == other.subtypeSpec))
110
111 def isSuperTypeOf(self, other, matchTags=True, matchConstraints=True):
112 """Examine |ASN.1| type for subtype relationship with other ASN.1 type.

Callers 3

encodeValueMethod · 0.80
_encodeComponentsMethod · 0.80
encodeValueMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected