Python Forum
Which versions of ipython implement --classic correctly
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Which versions of ipython implement --classic correctly
#1
In my PyClical software, I include doctests. To run these doctests as part of a larger test suite, written as bash shell scripts, I run

ipython --classic --no-banner < test.py > test.out

and compare the output in test.out -- including the '>>> ' prompts -- with previous test output.

Up until recently, this has worked. Now that I am using iPython 5.1, it has stopped working, because iPython is no longer producing '>>> ' prompts, seemingly ignoring the '--classic' option, and instead, it prompts using 'In [1]: ', 'Out[1]: ' etc.
  1. Is this a bug in iPython 5.X? Is it known or should I report it?
  2. Is is actually a bug in iPython versions earlier than 5, that should have ignored the '--classic' option for reasons that I don't understand?
  3. Was I relying on undocumented behaviour?
  4. How do I write a test script that works with every users' version of iPython, regardless of this bug? Should I just wait for the bug to be fixed and warn users that they can't test using certain versions of iPython that are known to be buggy?
Reply
#2
as far as i know, all Ipython shells will replace [>>>] with in[0:] out[1:]. the reason for this is because, ipython allows editing of code, and multiple lines of code, directly into the shell without having to pre-script it. it is quite literally the same shell as IDLE or say ninja, it is the same as any other python shell, however because it allows realtime editing, the prompt is changed to show you what lines your on, what your input and output are, and a whole new set of keyboard shortcuts are added to allow for more effective editing. if you are finding it too confusing, i recommend just practicing with pre-scripting, writing a whole python document before running it. Ipython is for more experienced users to edit their code as it runs or to write their code in realtime. i personally do not feel even i am advanced enough to use such a tool. i hope this is accurate and helpful, and i hope someone more experienced than i can give you a better reply, but thats the gist of my knowledge of it.

it isnt a bug
it isnt an error
it is exactly how Ipython is supposed to function, as far as i can tell from your description.

maybe the syntax for classic prompt has changed? is my only other thought on in. check the new documentation?
Reply
#3
Thanks for your reply. Have you read and understood the documentation of the '--classic' option? Have you read the part of my question where I said that before iPython 5, the execution of the test resulted in '>>> ' prompts, and it is only with my use of IPython 5.1 that I have seen different behaviour, i.e. something has definitely changed? If "it isn't a bug" now, and it wasn't a bug then, please explain the undocumented change in behaviour.
Reply
#4
as i mentioned before, i am most definitely not the most advanced user in this board, and i do hope you get a more thorough reply.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  IPython errors for numpy array min/max methods muelaner 1 561 Nov-04-2023, 09:22 PM
Last Post: snippsat
  Can a program execute code in iPython shell and get result? deanhystad 3 1,735 Jun-17-2022, 03:45 AM
Last Post: Larz60+
  Right way to implement interfaces yossiy123 1 1,274 May-12-2022, 10:31 AM
Last Post: Gribouillis
  numpy.dot() result different with classic computation for large-size arrays geekgeek 5 1,892 Jan-25-2022, 09:45 PM
Last Post: Gribouillis
Question best way to implement algorithm hamidze 3 2,213 Feb-27-2021, 07:10 PM
Last Post: hamidze
  IPython console vs Spyder script losc 3 2,728 Apr-30-2020, 04:57 AM
Last Post: deanhystad
  How can I create a multiline input in ipython? DataMower 3 4,373 Oct-28-2019, 08:50 PM
Last Post: DataMower
  ipython autocomplete broke indentation! Exsul 6 4,527 Aug-20-2019, 01:29 AM
Last Post: Exsul
  How to clear IPython console in Spyder? Vai 7 55,937 Aug-20-2018, 09:43 PM
Last Post: james_balcomb
  Stopwatch in Python/IPython shell suvadip 3 4,303 Jul-06-2018, 01:51 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020