summaryrefslogtreecommitdiffstats
path: root/Lib/profile.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-12-17 15:25:27 (GMT)
committerGuido van Rossum <guido@python.org>1993-12-17 15:25:27 (GMT)
commit7bc817d5ba917528e8bd07ec461c635291e7b06a (patch)
treed244fa2c8a15248efe095823be9f5e690a2efe38 /Lib/profile.py
parentaa14837bd00c28997dbde4014f8c994b9482def1 (diff)
downloadcpython-7bc817d5ba917528e8bd07ec461c635291e7b06a.zip
cpython-7bc817d5ba917528e8bd07ec461c635291e7b06a.tar.gz
cpython-7bc817d5ba917528e8bd07ec461c635291e7b06a.tar.bz2
* Mass change: get rid of all init() methods, in favor of __init__()
constructors. There is no backward compatibility. Not everything has been tested. * aiff.{py,doc}: deleted in favor of aifc.py (which contains its docs as comments)
Diffstat (limited to 'Lib/profile.py')
-rwxr-xr-xLib/profile.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/Lib/profile.py b/Lib/profile.py
index 19b0476..502a4db 100755
--- a/Lib/profile.py
+++ b/Lib/profile.py
@@ -14,13 +14,12 @@ import marshal
class Profile:
- def init(self):
+ def __init__(self):
self.timings = {}
self.debug = None
self.call_level = 0
self.profile_func = None
self.profiling = 0
- return self
def profile(self, funcname):
if not self.profile_func:
@@ -230,12 +229,11 @@ def depth(frame):
return d
class Stats:
- def init(self, file):
+ def __init__(self, file):
f = open(file, 'r')
self.stats = marshal.load(f)
f.close()
self.stats_list = None
- return self
def print_stats(self):
print_title()
@@ -354,7 +352,7 @@ def f8(x):
# simplified user interface
def run(statement, *args):
- prof = Profile().init()
+ prof = Profile()
try:
prof.run(statement)
except SystemExit:
@@ -366,7 +364,7 @@ def run(statement, *args):
# test command with debugging
def debug():
- prof = Profile().init()
+ prof = Profile()
prof.debug = 1
try:
prof.run('import x; x.main()')