annotate Lib/test/inspect_fodder.py @ 78069:a8aa77458e12 3.2

Add c_size_t and c_ssize_t to the ctypes summary table.
author Antoine Pitrou <solipsis@pitrou.net>
date Thu, 12 Jul 2012 20:31:50 +0200
parents 9ad84070b22d
children 39d0dfa5808c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
34151
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
1 # line 1
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
2 'A module docstring.'
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
3
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
4 import sys, inspect
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
5 # line 5
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
6
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
7 # line 7
41717
9ad84070b22d Merged revisions 55328-55341 via svnmerge from
Guido van Rossum <guido@python.org>
parents: 34151
diff changeset
8 def spam(a, b, c, d=3, e=4, f=5, *g, **h):
34151
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
9 eggs(b + d, c + f)
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
10
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
11 # line 11
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
12 def eggs(x, y):
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
13 "A docstring."
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
14 global fr, st
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
15 fr = inspect.currentframe()
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
16 st = inspect.stack()
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
17 p = x
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
18 q = y / 0
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
19
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
20 # line 20
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
21 class StupidGit:
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
22 """A longer,
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
23
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
24 indented
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
25
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
26 docstring."""
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
27 # line 27
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
28
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
29 def abuse(self, a, b, c):
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
30 """Another
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
31
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
32 \tdocstring
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
33
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
34 containing
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
35
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
36 \ttabs
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
37 \t
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
38 """
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
39 self.argue(a, b, c)
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
40 # line 40
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
41 def argue(self, a, b, c):
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
42 try:
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
43 spam(a, b, c)
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
44 except:
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
45 self.ex = sys.exc_info()
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
46 self.tr = inspect.trace()
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
47
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
48 # line 48
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
49 class MalodorousPervert(StupidGit):
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
50 pass
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
51
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
52 class ParrotDroppings:
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
53 pass
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
54
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
55 class FesteringGob(MalodorousPervert, ParrotDroppings):
de4701fc176f Patch #736962: port test_inspect to unittest. As part of this, move out
Johannes Gijsbers <jlg@dds.nl>
parents:
diff changeset
56 pass