Jason R. Coombs  committed 85849e3

Even better support for encoding nested objects

  • Participants
  • Parent commits a63d4ed
  • Branches default

Comments (0)

Files changed (1)

File jaraco/json/

 	the pickle module works.
 	def default(self, object):
+		# process items of lists and dicts recursively
+		if isinstance(object, (list, tuple)):
+			return map(self.default, object)
+		if isinstance(object, dict):
+			return dict((self.default(key), self.default(value)) for key, value in object.items())
 		if object.__class__.__module__ == '__builtin__':
 			# Builtin objects are handled in the parent
 			return object