Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 6 commits
  • 4 files changed
  • 0 commit comments
  • 2 contributors
Showing with 32 additions and 10 deletions.
  1. +2 −0  HISTORY.txt
  2. +14 −9 README.rst
  3. +4 −1 ipdb/__init__.py
  4. +12 −0 ipdb/__main__.py
View
2  HISTORY.txt
@@ -6,6 +6,8 @@ Changelog
- Python 3 support.
[Piet Delport]
+- Added the functions ``runcall``, ``runeval`` and ``run``.
+ [dimasad]
0.6.1 (2011-10-17)
View
23 README.rst
@@ -1,20 +1,25 @@
IPython `pdb`
=============
-Use
+Use
+---
-::
-
- from ipdb import set_trace; set_trace()
-
-or
+ipdb exports functions to access the IPython_ debugger, which features
+tab completion, syntax highlighting, better tracebacks, better introspection
+with the same interface as the `pdb` module.
+Example usage:
::
- from ipdb import pm; pm()
+ import ipdb
+ ipdb.set_trace()
+ ipdb.pm()
+ ipdb.run('x[0] = 3')
+ result = ipdb.runcall(function, arg0, arg1, kwarg='foo')
+ result = ipdb.runeval('f(1,2) - 3')
-You then get all IPython_ features (tab completion, syntax highlighting, better
-tracebacks, better introspection) right in `pdb`.
+The post-mortem function, ``ipdb.pm()``, is equivalent to the magic function
+``%debug``.
.. _IPython: http://ipython.org
View
5 ipdb/__init__.py
@@ -1,5 +1,8 @@
-from ipdb.__main__ import set_trace, post_mortem, pm
+from ipdb.__main__ import set_trace, post_mortem, pm, run, runcall, runeval
pm # please pyflakes
post_mortem # please pyflakes
+run # please pyflakes
+runcall # please pyflakes
+runeval # please pyflakes
set_trace # please pyflakes
View
12 ipdb/__main__.py
@@ -70,6 +70,18 @@ def pm():
post_mortem(sys.last_traceback)
+def run(statement, globals=None, locals=None):
+ Pdb(def_colors).run(statement, globals, locals)
+
+
+def runcall(*args, **kwargs):
+ return Pdb(def_colors).runcall(*args, **kwargs)
+
+
+def runeval(expression, globals=None, locals=None):
+ return Pdb(def_colors).runeval(expression, globals, locals)
+
+
def main():
if not sys.argv[1:] or sys.argv[1] in ("--help", "-h"):
print "usage: ipdb.py scriptfile [arg] ..."

No commit comments for this range

Something went wrong with that request. Please try again.