INNER CODE UNIT · Python
Castable
wbond/asn1crypto · asn1crypto/core.py:693
class Castable(object):
"""
A mixin to handle converting an object between different classes that
represent the same encoded value, but with different rules for converting
to and from native Python values
"""
def cast(self, other_class):
"""
Converts the current object into an object of a different class. The
new class must use the ASN.1 encoding for the value.
:param other_class:
The class to instantiate the new object from
:return:
An instance of the type other_class
"""