setting variables in pdb

John Posner jjposner at optimum.net
Tue May 18 16:32:15 EDT 2010


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





More information about the Python-list mailing list