]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
pdb.py, bdb.py, cmd.py: use __init__() instead of init()
authorGuido van Rossum <guido@python.org>
Wed, 23 Jun 1993 11:55:24 +0000 (11:55 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 23 Jun 1993 11:55:24 +0000 (11:55 +0000)
Lib/bdb.py
Lib/cmd.py
Lib/pdb.py

index 66d3457c6b7a5f6ca17354b41280054512cbde04..bc0b282e01f040f6905aa902442e4d382d50df90 100644 (file)
@@ -13,8 +13,10 @@ BdbQuit = 'bdb.BdbQuit' # Exception to give up completely
 
 class Bdb: # Basic Debugger
        
-       def init(self):
+       def __init__(self):
                self.breaks = {}
+
+       def init(self):                 # BW compat only
                return self
        
        def reset(self):
@@ -303,5 +305,5 @@ def bar(a):
 def test():
        import linecache
        linecache.checkcache()
-       t = Tdb().init()
+       t = Tdb()
        t.run('import bdb; bdb.foo(10)')
index 7c512def60a74489cf3e44317aef8c5815de63e5..c4a347d2a6a35fa542cc6a96a623d95dfc793070 100644 (file)
@@ -14,7 +14,7 @@ class Cmd:
                self.identchars = IDENTCHARS
                self.lastcmd = ''
        
-       def init(self):
+       def init(self):                 # BW compat only
                return self
 
        def cmdloop(self):
index b8446aab6c330996c6e8c13de3777a2fb9323a3e..c5d3e1c2a3319a5bd1806e00cd6d538ccc5bfe95 100755 (executable)
@@ -12,10 +12,12 @@ import repr
 
 class Pdb(bdb.Bdb, cmd.Cmd):
        
-       def init(self):
-               self = bdb.Bdb.init(self)
-               self = cmd.Cmd.init(self)
+       def __init__(self):
+               bdb.Bdb.__init__(self)
+               cmd.Cmd.__init__(self)
                self.prompt = '(Pdb) '
+
+       def init(self):                 # BW compat only
                return self
        
        def reset(self):
@@ -277,19 +279,19 @@ class Pdb(bdb.Bdb, cmd.Cmd):
 # Simplified interface
 
 def run(statement):
-       Pdb().init().run(statement)
+       Pdb().run(statement)
 
 def runctx(statement, globals, locals):
-       Pdb().init().runctx(statement, globals, locals)
+       Pdb().runctx(statement, globals, locals)
 
 def runcall(*args):
-       apply(Pdb().init().runcall, args)
+       apply(Pdb().runcall, args)
 
 
 # Post-Mortem interface
 
 def post_mortem(t):
-       p = Pdb().init()
+       p = Pdb()
        p.reset()
        while t.tb_next <> None: t = t.tb_next
        p.interaction(t.tb_frame, t)