1 | n/a | """Something just to look at via pydoc.""" |
---|
2 | n/a | |
---|
3 | n/a | import types |
---|
4 | n/a | |
---|
5 | n/a | class A_classic: |
---|
6 | n/a | "A classic class." |
---|
7 | n/a | def A_method(self): |
---|
8 | n/a | "Method defined in A." |
---|
9 | n/a | def AB_method(self): |
---|
10 | n/a | "Method defined in A and B." |
---|
11 | n/a | def AC_method(self): |
---|
12 | n/a | "Method defined in A and C." |
---|
13 | n/a | def AD_method(self): |
---|
14 | n/a | "Method defined in A and D." |
---|
15 | n/a | def ABC_method(self): |
---|
16 | n/a | "Method defined in A, B and C." |
---|
17 | n/a | def ABD_method(self): |
---|
18 | n/a | "Method defined in A, B and D." |
---|
19 | n/a | def ACD_method(self): |
---|
20 | n/a | "Method defined in A, C and D." |
---|
21 | n/a | def ABCD_method(self): |
---|
22 | n/a | "Method defined in A, B, C and D." |
---|
23 | n/a | |
---|
24 | n/a | |
---|
25 | n/a | class B_classic(A_classic): |
---|
26 | n/a | "A classic class, derived from A_classic." |
---|
27 | n/a | def AB_method(self): |
---|
28 | n/a | "Method defined in A and B." |
---|
29 | n/a | def ABC_method(self): |
---|
30 | n/a | "Method defined in A, B and C." |
---|
31 | n/a | def ABD_method(self): |
---|
32 | n/a | "Method defined in A, B and D." |
---|
33 | n/a | def ABCD_method(self): |
---|
34 | n/a | "Method defined in A, B, C and D." |
---|
35 | n/a | def B_method(self): |
---|
36 | n/a | "Method defined in B." |
---|
37 | n/a | def BC_method(self): |
---|
38 | n/a | "Method defined in B and C." |
---|
39 | n/a | def BD_method(self): |
---|
40 | n/a | "Method defined in B and D." |
---|
41 | n/a | def BCD_method(self): |
---|
42 | n/a | "Method defined in B, C and D." |
---|
43 | n/a | |
---|
44 | n/a | class C_classic(A_classic): |
---|
45 | n/a | "A classic class, derived from A_classic." |
---|
46 | n/a | def AC_method(self): |
---|
47 | n/a | "Method defined in A and C." |
---|
48 | n/a | def ABC_method(self): |
---|
49 | n/a | "Method defined in A, B and C." |
---|
50 | n/a | def ACD_method(self): |
---|
51 | n/a | "Method defined in A, C and D." |
---|
52 | n/a | def ABCD_method(self): |
---|
53 | n/a | "Method defined in A, B, C and D." |
---|
54 | n/a | def BC_method(self): |
---|
55 | n/a | "Method defined in B and C." |
---|
56 | n/a | def BCD_method(self): |
---|
57 | n/a | "Method defined in B, C and D." |
---|
58 | n/a | def C_method(self): |
---|
59 | n/a | "Method defined in C." |
---|
60 | n/a | def CD_method(self): |
---|
61 | n/a | "Method defined in C and D." |
---|
62 | n/a | |
---|
63 | n/a | class D_classic(B_classic, C_classic): |
---|
64 | n/a | "A classic class, derived from B_classic and C_classic." |
---|
65 | n/a | def AD_method(self): |
---|
66 | n/a | "Method defined in A and D." |
---|
67 | n/a | def ABD_method(self): |
---|
68 | n/a | "Method defined in A, B and D." |
---|
69 | n/a | def ACD_method(self): |
---|
70 | n/a | "Method defined in A, C and D." |
---|
71 | n/a | def ABCD_method(self): |
---|
72 | n/a | "Method defined in A, B, C and D." |
---|
73 | n/a | def BD_method(self): |
---|
74 | n/a | "Method defined in B and D." |
---|
75 | n/a | def BCD_method(self): |
---|
76 | n/a | "Method defined in B, C and D." |
---|
77 | n/a | def CD_method(self): |
---|
78 | n/a | "Method defined in C and D." |
---|
79 | n/a | def D_method(self): |
---|
80 | n/a | "Method defined in D." |
---|
81 | n/a | |
---|
82 | n/a | |
---|
83 | n/a | class A_new(object): |
---|
84 | n/a | "A new-style class." |
---|
85 | n/a | |
---|
86 | n/a | def A_method(self): |
---|
87 | n/a | "Method defined in A." |
---|
88 | n/a | def AB_method(self): |
---|
89 | n/a | "Method defined in A and B." |
---|
90 | n/a | def AC_method(self): |
---|
91 | n/a | "Method defined in A and C." |
---|
92 | n/a | def AD_method(self): |
---|
93 | n/a | "Method defined in A and D." |
---|
94 | n/a | def ABC_method(self): |
---|
95 | n/a | "Method defined in A, B and C." |
---|
96 | n/a | def ABD_method(self): |
---|
97 | n/a | "Method defined in A, B and D." |
---|
98 | n/a | def ACD_method(self): |
---|
99 | n/a | "Method defined in A, C and D." |
---|
100 | n/a | def ABCD_method(self): |
---|
101 | n/a | "Method defined in A, B, C and D." |
---|
102 | n/a | |
---|
103 | n/a | def A_classmethod(cls, x): |
---|
104 | n/a | "A class method defined in A." |
---|
105 | n/a | A_classmethod = classmethod(A_classmethod) |
---|
106 | n/a | |
---|
107 | n/a | def A_staticmethod(): |
---|
108 | n/a | "A static method defined in A." |
---|
109 | n/a | A_staticmethod = staticmethod(A_staticmethod) |
---|
110 | n/a | |
---|
111 | n/a | def _getx(self): |
---|
112 | n/a | "A property getter function." |
---|
113 | n/a | def _setx(self, value): |
---|
114 | n/a | "A property setter function." |
---|
115 | n/a | def _delx(self): |
---|
116 | n/a | "A property deleter function." |
---|
117 | n/a | A_property = property(fdel=_delx, fget=_getx, fset=_setx, |
---|
118 | n/a | doc="A sample property defined in A.") |
---|
119 | n/a | |
---|
120 | n/a | A_int_alias = int |
---|
121 | n/a | |
---|
122 | n/a | class B_new(A_new): |
---|
123 | n/a | "A new-style class, derived from A_new." |
---|
124 | n/a | |
---|
125 | n/a | def AB_method(self): |
---|
126 | n/a | "Method defined in A and B." |
---|
127 | n/a | def ABC_method(self): |
---|
128 | n/a | "Method defined in A, B and C." |
---|
129 | n/a | def ABD_method(self): |
---|
130 | n/a | "Method defined in A, B and D." |
---|
131 | n/a | def ABCD_method(self): |
---|
132 | n/a | "Method defined in A, B, C and D." |
---|
133 | n/a | def B_method(self): |
---|
134 | n/a | "Method defined in B." |
---|
135 | n/a | def BC_method(self): |
---|
136 | n/a | "Method defined in B and C." |
---|
137 | n/a | def BD_method(self): |
---|
138 | n/a | "Method defined in B and D." |
---|
139 | n/a | def BCD_method(self): |
---|
140 | n/a | "Method defined in B, C and D." |
---|
141 | n/a | |
---|
142 | n/a | class C_new(A_new): |
---|
143 | n/a | "A new-style class, derived from A_new." |
---|
144 | n/a | |
---|
145 | n/a | def AC_method(self): |
---|
146 | n/a | "Method defined in A and C." |
---|
147 | n/a | def ABC_method(self): |
---|
148 | n/a | "Method defined in A, B and C." |
---|
149 | n/a | def ACD_method(self): |
---|
150 | n/a | "Method defined in A, C and D." |
---|
151 | n/a | def ABCD_method(self): |
---|
152 | n/a | "Method defined in A, B, C and D." |
---|
153 | n/a | def BC_method(self): |
---|
154 | n/a | "Method defined in B and C." |
---|
155 | n/a | def BCD_method(self): |
---|
156 | n/a | "Method defined in B, C and D." |
---|
157 | n/a | def C_method(self): |
---|
158 | n/a | "Method defined in C." |
---|
159 | n/a | def CD_method(self): |
---|
160 | n/a | "Method defined in C and D." |
---|
161 | n/a | |
---|
162 | n/a | class D_new(B_new, C_new): |
---|
163 | n/a | """A new-style class, derived from B_new and C_new. |
---|
164 | n/a | """ |
---|
165 | n/a | |
---|
166 | n/a | def AD_method(self): |
---|
167 | n/a | "Method defined in A and D." |
---|
168 | n/a | def ABD_method(self): |
---|
169 | n/a | "Method defined in A, B and D." |
---|
170 | n/a | def ACD_method(self): |
---|
171 | n/a | "Method defined in A, C and D." |
---|
172 | n/a | def ABCD_method(self): |
---|
173 | n/a | "Method defined in A, B, C and D." |
---|
174 | n/a | def BD_method(self): |
---|
175 | n/a | "Method defined in B and D." |
---|
176 | n/a | def BCD_method(self): |
---|
177 | n/a | "Method defined in B, C and D." |
---|
178 | n/a | def CD_method(self): |
---|
179 | n/a | "Method defined in C and D." |
---|
180 | n/a | def D_method(self): |
---|
181 | n/a | "Method defined in D." |
---|
182 | n/a | |
---|
183 | n/a | class FunkyProperties(object): |
---|
184 | n/a | """From SF bug 472347, by Roeland Rengelink. |
---|
185 | n/a | |
---|
186 | n/a | Property getters etc may not be vanilla functions or methods, |
---|
187 | n/a | and this used to make GUI pydoc blow up. |
---|
188 | n/a | """ |
---|
189 | n/a | |
---|
190 | n/a | def __init__(self): |
---|
191 | n/a | self.desc = {'x':0} |
---|
192 | n/a | |
---|
193 | n/a | class get_desc: |
---|
194 | n/a | def __init__(self, attr): |
---|
195 | n/a | self.attr = attr |
---|
196 | n/a | def __call__(self, inst): |
---|
197 | n/a | print('Get called', self, inst) |
---|
198 | n/a | return inst.desc[self.attr] |
---|
199 | n/a | class set_desc: |
---|
200 | n/a | def __init__(self, attr): |
---|
201 | n/a | self.attr = attr |
---|
202 | n/a | def __call__(self, inst, val): |
---|
203 | n/a | print('Set called', self, inst, val) |
---|
204 | n/a | inst.desc[self.attr] = val |
---|
205 | n/a | class del_desc: |
---|
206 | n/a | def __init__(self, attr): |
---|
207 | n/a | self.attr = attr |
---|
208 | n/a | def __call__(self, inst): |
---|
209 | n/a | print('Del called', self, inst) |
---|
210 | n/a | del inst.desc[self.attr] |
---|
211 | n/a | |
---|
212 | n/a | x = property(get_desc('x'), set_desc('x'), del_desc('x'), 'prop x') |
---|
213 | n/a | |
---|
214 | n/a | |
---|
215 | n/a | submodule = types.ModuleType(__name__ + '.submodule', |
---|
216 | n/a | """A submodule, which should appear in its parent's summary""") |
---|