Enabling tab completion in pdb

I will admit being a big fan of pdb, and the debugging functionalities it provides. It still could do more by adding tab completion to guess attributes for python objects. In this post, we will try to address this caveat. Setting up Tab Completion Create a .pdbrc in your home directory. Add the following contents to the file # this adds tab completion import rlcompleter __import__('pdb').Pdb.complete = rlcompleter.Completer(locals()).complete Just save this file and use breakpoint(or import pdb;pdb....

April 1, 2021 · 1 min

Random python nuggets

Python is already packed with insanely good standard libraries which often makes our job incredibly easy to solve. Apart from that, it comes with some hidden features(also known as easter eggs) that may amaze you. Let’s start: The Zen of Python >>> import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated....

March 15, 2021 · 2 min