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