From: Art on
If I am in Pdb, I would like to set a temporary variable, for example:

(Pdb) r = 1

The 'r' gets interpreted as 'return' by Pdb.

Is there a Pdb instruction that guarantees the intended effect, like:

(Pdb) let r = 1

I can usually avoid using such variable names, but if I am changing
the value of a local variable, it is convenient to be able to make
sure that trying to change that variable doesn't unintentionally call
a Pdb routine.

Thanks,
Art.
From: John Posner on
On 5/18/2010 4:15 PM, Art wrote:
> If I am in Pdb, I would like to set a temporary variable, for example:
>
> (Pdb) r = 1
>
> The 'r' gets interpreted as 'return' by Pdb.
>
> Is there a Pdb instruction that guarantees the intended effect, like:
>
> (Pdb) let r = 1
>
> I can usually avoid using such variable names, but if I am changing
> the value of a local variable, it is convenient to be able to make
> sure that trying to change that variable doesn't unintentionally call
> a Pdb routine.


Try setting *two* values at the interactive prompt:

foo, r = 0, 3456

Variable "r" now has the value 3456.

HTH,
John


From: Duncan Booth on
Art <grenander(a)gmail.com> wrote:

> If I am in Pdb, I would like to set a temporary variable, for example:
>
> (Pdb) r = 1
>
> The 'r' gets interpreted as 'return' by Pdb.
>
> Is there a Pdb instruction that guarantees the intended effect, like:
>
> (Pdb) let r = 1

(Pdb) exec "r=1"