name.pyi 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. from typing import Optional, Union, Tuple, Iterable, List
  2. have_idna_2008: bool
  3. class Name:
  4. def is_subdomain(self, o : Name) -> bool: ...
  5. def is_superdomain(self, o : Name) -> bool: ...
  6. def __init__(self, labels : Iterable[Union[bytes,str]]) -> None:
  7. self.labels : List[bytes]
  8. def is_absolute(self) -> bool: ...
  9. def is_wild(self) -> bool: ...
  10. def fullcompare(self, other) -> Tuple[int,int,int]: ...
  11. def canonicalize(self) -> Name: ...
  12. def __eq__(self, other) -> bool: ...
  13. def __ne__(self, other) -> bool: ...
  14. def __lt__(self, other : Name) -> bool: ...
  15. def __le__(self, other : Name) -> bool: ...
  16. def __ge__(self, other : Name) -> bool: ...
  17. def __gt__(self, other : Name) -> bool: ...
  18. def to_text(self, omit_final_dot=False) -> str: ...
  19. def to_unicode(self, omit_final_dot=False, idna_codec=None) -> str: ...
  20. def to_digestable(self, origin=None) -> bytes: ...
  21. def to_wire(self, file=None, compress=None, origin=None,
  22. canonicalize=False) -> Optional[bytes]: ...
  23. def __add__(self, other : Name) -> Name: ...
  24. def __sub__(self, other : Name) -> Name: ...
  25. def split(self, depth) -> List[Tuple[str,str]]: ...
  26. def concatenate(self, other : Name) -> Name: ...
  27. def relativize(self, origin) -> Name: ...
  28. def derelativize(self, origin) -> Name: ...
  29. def choose_relativity(self, origin : Optional[Name] = None, relativize=True) -> Name: ...
  30. def parent(self) -> Name: ...
  31. class IDNACodec:
  32. pass
  33. def from_text(text, origin : Optional[Name] = Name('.'), idna_codec : Optional[IDNACodec] = None) -> Name:
  34. ...
  35. empty : Name