Package rekall :: Module obj :: Class ProfileLog :: Class JSONEncoder
[frames] | no frames]

Class JSONEncoder

source code


Instance Methods
 
default(self, obj)
Implement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``).
source code

Inherited from json.encoder.JSONEncoder: __init__, encode, iterencode

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods
 
as_set(obj) source code
Class Variables

Inherited from json.encoder.JSONEncoder: item_separator, key_separator

Properties

Inherited from object: __class__

Method Details

default(self, obj)

source code 

Implement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``).

For example, to support arbitrary iterators, you could implement default like this:

   def default(self, o):
       try:
           iterable = iter(o)
       except TypeError:
           pass
       else:
           return list(iterable)
       # Let the base class default method raise the TypeError
       return JSONEncoder.default(self, o)
Overrides: json.encoder.JSONEncoder.default
(inherited documentation)