pydoc_mod.py 1000 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. """This is a test module for test_pydoc"""
  2. from __future__ import print_function
  3. import types
  4. import typing
  5. __author__ = "Benjamin Peterson"
  6. __credits__ = "Nobody"
  7. __version__ = "1.2.3.4"
  8. __xyz__ = "X, Y and Z"
  9. class A:
  10. """Hello and goodbye"""
  11. def __init__():
  12. """Wow, I have no function!"""
  13. pass
  14. class B(object):
  15. NO_MEANING: str = "eggs"
  16. pass
  17. class C(object):
  18. def say_no(self):
  19. return "no"
  20. def get_answer(self):
  21. """ Return say_no() """
  22. return self.say_no()
  23. def is_it_true(self):
  24. """ Return self.get_answer() """
  25. return self.get_answer()
  26. def __class_getitem__(self, item):
  27. return types.GenericAlias(self, item)
  28. def doc_func():
  29. """
  30. This function solves all of the world's problems:
  31. hunger
  32. lack of Python
  33. war
  34. """
  35. def nodoc_func():
  36. pass
  37. list_alias1 = typing.List[int]
  38. list_alias2 = list[int]
  39. c_alias = C[int]
  40. type_union1 = typing.Union[int, str]
  41. type_union2 = int | str