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

Method getTypeByPosition

pager_lib/pyasn1/type/namedtype.py:272–294  ·  view source on GitHub ↗

Return ASN.1 type object by its position in fields set. Parameters ---------- idx: :py:class:`int` Field index Returns ------- : ASN.1 type Raises ------ ~pyasn1.error.PyAsn1Error If given

(self, idx)

Source from the content-addressed store, hash-verified

270 return ambiguousTypes
271
272 def getTypeByPosition(self, idx):
273 """Return ASN.1 type object by its position in fields set.
274
275 Parameters
276 ----------
277 idx: :py:class:`int`
278 Field index
279
280 Returns
281 -------
282 :
283 ASN.1 type
284
285 Raises
286 ------
287 ~pyasn1.error.PyAsn1Error
288 If given position is out of fields range
289 """
290 try:
291 return self.__namedTypes[idx].asn1Object
292
293 except IndexError:
294 raise error.PyAsn1Error('Type position out of range')
295
296 def getPositionByType(self, tagSet):
297 """Return field position by its ASN.1 type.

Callers 2

setComponentByTypeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected