X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=.ipython%2Fprofile_default%2Fstartup%2F50-dump.py;h=11195a7763c5599de20f792b30f136edeb7de7a5;hb=22072cded51c50548aa955366c67edc44a46fcce;hp=e1910eae62059286bf136ff198338a8db967d73f;hpb=91523915df9d9eaecf40125db37fd988f2aef476;p=home.git diff --git a/.ipython/profile_default/startup/50-dump.py b/.ipython/profile_default/startup/50-dump.py index e1910ea..11195a7 100644 --- a/.ipython/profile_default/startup/50-dump.py +++ b/.ipython/profile_default/startup/50-dump.py @@ -25,8 +25,8 @@ class Dump(object): # Objects that hold multiple objects (can be looped over). TYPES_ITERABLES = ( types.GeneratorType, - types.ListType, - types.TupleType, + list, + tuple, ) # Objects that we shouldn't really probe. @@ -37,23 +37,21 @@ class Dump(object): # Simple objects we don't decode further. TYPES_SCALAR = ( - types.BooleanType, - types.ComplexType, - types.FloatType, - types.IntType, - types.LongType, - types.NoneType, - types.StringType, - types.UnicodeType, - - types.ClassType, - types.TypeType, + bool, + complex, + float, + int, + #types.LongType, + type(None), + bytes, + str, + + type, ) # Objects that are dictionary based. TYPES_DICT = ( - types.DictType, - types.DictionaryType, + dict, ) # Standard python objects we don't normally expand. @@ -110,7 +108,13 @@ class Dump(object): return s def dump(self, obj, depth=0, name=None): - """Dump |obj| with |name|""" + """Dump |obj| with |name|. + + Args: + obj: The object to dump. + depth: How deep to recursively dive. + name: The name? + """ indent = ' ' * depth def w(msg, indent=indent, color=None): for line in msg.splitlines(): @@ -202,3 +206,4 @@ class Dump(object): def dump(*args, **kwargs): d = Dump(*args, **kwargs) del d +dump.__doc__ = Dump.dump.__doc__