Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#2 python-mode patch for ipython support

closed-accepted
None
5
2005-06-07
2003-08-05
Skip Montanaro
No

migrating #575774 from the python project.

Original submission:

This patch makes the prompt and traceback
recognition
mechanisms a bit more flexible to allow easy
adaptation
for ipython (in lieu of the normal python shell). The
seperate file ipython.el (which I assume will end up in
the ipython distribution) then enables
py-execute-region, py-up-exception etc. to work just
as
well for ipython (which means ipython works just as
well under python mode as the standard python
shell). I
also added something to ipython.el to convert
ipython
session bits to something that looks like normal
interactive session bits. This, together with ipython's
ability to directly execute such strings (by
auto-removing leading '>>>'s) should make for very
convinient doctest development (I had orginally
planned
to patch python-mode to incorporate such
functionality
because I found the manual reediting a bit tiresome).

Slightly off-topic, I also have a feature request:
executing a whole file ends up creating a temporary
file which is instead executed. I think it would be
much nicer if the actual file itself where executed
with execfile, because otherwise pdb ends up
pointing
to the "wrong" (i.e. the temporary) buffer. It is
really easy to forget about this and edit this
temporary file during a debugging session and as a
consequence inadvertenly loose changes. This
situation
crops up quite often, if one uses ipython's really
nifty feature to toggle pdb activation on exceptions
(or hacks up something equivalent for python), which
is
an extremely efficient way to quickly debug and test
one's program. I would have added a patch, but
some
restructuring seemed necessary, and it wasn't
immediately clear to me in which way this should be
done.

Discussion

  • Skip Montanaro
    Skip Montanaro
    2005-06-07

    • assigned_to: nobody --> montanaro
    • status: open --> closed-accepted
     
  • Skip Montanaro
    Skip Montanaro
    2005-06-07

    Logged In: YES
    user_id=44345

    Last of the parts of this were added in 4.75.