Author erixoltan
Recipients erixoltan
Date 2017-04-18.18:32:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I have created a pdb enhancement that allows me to query an object's internals more gracefully. It is incredibly useful and it would be very easy to include this logic in the distribution version of pdb. 

I created my own modification of pdb called zdebug (attached as that implements a new ppp debugging command. This command prints a formatted output of an object's internals. It could be smoother, and doesn't fully obey the programming conventions used with in pdb, and I'm not proposing to submit it as a patch. However the ppp command is pretty simple and incredibly useful.  

Here's a tiny example. I can drill into an object, see its internals, and interactively explore its property chain. (The zdebug.zbreak() call is equivalent to pdb.set_trace()). 

$ python3
>>> from datetime import date
>>> today =
>>> import zdebug
>>> zdebug.zbreak()
> <stdin>(1)<module>()->None
zdebug> p today, 4, 18)
zdebug> ppp today
   ctime = <built-in method ctime of object at 0x7fc688a1cf50>
   day = 18
   fromordinal = <built-in method fromordinal of type object at 0x562b84a60d60>
   fromtimestamp = <built-in method fromtimestamp of type object at 0x562b84a60d60>
   isocalendar = <built-in method isocalendar of object at 0x7fc688a1cf50>
   isoformat = <built-in method isoformat of object at 0x7fc688a1cf50>
   isoweekday = <built-in method isoweekday of object at 0x7fc688a1cf50>
   max = 9999-12-31
   min = 0001-01-01
   month = 4
   replace = <built-in method replace of object at 0x7fc688a1cf50>
   resolution = 1 day, 0:00:00
   strftime = <built-in method strftime of object at 0x7fc688a1cf50>
   timetuple = <built-in method timetuple of object at 0x7fc688a1cf50>
   today = <built-in method today of type object at 0x562b84a60d60>
   toordinal = <built-in method toordinal of object at 0x7fc688a1cf50>
   weekday = <built-in method weekday of object at 0x7fc688a1cf50>
   year = 2017

zdebug> p
zdebug> p today.year
Date User Action Args
2017-04-18 18:32:39erixoltansetrecipients: + erixoltan
2017-04-18 18:32:36erixoltansetmessageid: <>
2017-04-18 18:32:36erixoltanlinkissue30094 messages
2017-04-18 18:32:36erixoltancreate