MCPcopy Create free account
hub / github.com/rthalley/dnspython / to_text

Method to_text

dns/enum.py:60–69  ·  view source on GitHub ↗
(cls: Type[TIntEnum], value: int)

Source from the content-addressed store, hash-verified

58
59 @classmethod
60 def to_text(cls: Type[TIntEnum], value: int) -> str:
61 cls._check_value(value)
62 try:
63 text = cls(value).name
64 except ValueError:
65 text = None
66 text = cls._extra_to_text(value, text)
67 if text is None:
68 text = f"{cls._prefix()}{value}"
69 return text
70
71 @classmethod
72 def make(cls: Type[TIntEnum], value: int | str) -> TIntEnum:

Callers

nothing calls this directly

Calls 3

_check_valueMethod · 0.80
_extra_to_textMethod · 0.45
_prefixMethod · 0.45

Tested by

no test coverage detected