[Python-ideas] pdb.set_trace may not seem long

Guido van Rossum guido at python.org
Mon Apr 9 17:01:11 CEST 2012


I think this is unnecessary; if you find yourself typing that so much,
create a module with a one-letter name and put a bunch of one-letter
convenience functions in it. Or figure out how to create macros for
your editor.

On Mon, Apr 9, 2012 at 7:20 AM, Yuval Greenfield <ubershmekel at gmail.com> wrote:
> Proposal:
>
> pdb.st = pdb.set_trace
> -----------
>
> I find myself typing this a lot:
>
>     import pdb;pdb.set_trace()
>
> It's the int3 of python. When I want to debug an exact point in the code I
> use the above line.
>
> I hope I don't come off as spoiled, it's just that import pdb;pdb.pm() is so
> short that I can't help but wonder how better my life would be if I could
> do:
>
>     import pdb;pdb.st()
>
>
> What do you guys think? I know aliasing isn't cool since TSBOAPOOOWTDI but
> practicality beats purity....
>
>
> Yuval
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>



-- 
--Guido van Rossum (python.org/~guido)



More information about the Python-ideas mailing list