[IPython-user] Prompt expressions

Walter Dörwald walter at livinglogic.de
Thu Jun 15 16:07:56 CDT 2006


Ville Vainio wrote:
> On 6/15/06, Walter Dörwald <walter at livinglogic.de> wrote:
> 
>> Why not simply pass a prompt type to the generate_prompt hook:
>>     0 == input prompt
>>     1 == secondary input prompt
>>     2 == output prompt
>>
>> This might simplify stuff, as input and output prompts might share code.
> 
> It would force the user to copy-paste the code for output prompt if he
> just wanted to change the input prompt. 

In theory
    if type == 2: raise ipapi.TryNext
should work.

> The users typically only want
> to change one or the other but not both.

But if the prompts should be aligned both have to be changed.

But I guess this is the old multi dispatch problem.

> If instance sharing is required the user can always wire the hooks to
> different bound methods of the same object.

True.

Servus,
    Walter




More information about the IPython-user mailing list