# 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.
# 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.
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():
def dump(*args, **kwargs):
d = Dump(*args, **kwargs)
del d
+dump.__doc__ = Dump.dump.__doc__