def __str__(self):
        """
        :return: a nice text representation of the extension
        """
        if _lib.NID_subject_alt_name == self._nid:
            return self._subjectAltNameString()

        bio = _new_mem_buf()
        print_result = _lib.X509V3_EXT_print(bio, self._extension, 0, 0)
        _openssl_assert(print_result != 0)

        return _native(_bio_to_string(bio))

        :return: a nice text representation of the extension
        
stackoverflow/venv/lib/python3.6/site-packages/OpenSSL/crypto.py