bundles / IPython 9.3.0 / IPython / core / displayhook / DisplayHook / compute_format_data
function
IPython.core.displayhook:DisplayHook.compute_format_data
Signature
def compute_format_data ( self , result ) Summary
Compute format data of the object to be displayed.
Extended Summary
The format data is a generalization of the repr of an object. In the default implementation the format data is a dict of key value pair where the keys are valid MIME types and the values are JSON'able data structure containing the raw data for that MIME type. It is up to frontends to determine pick a MIME to to use and display that data in an appropriate manner.
This method only computes the format data for the object and should NOT actually print or write that to a stream.
Parameters
result: objectThe Python object passed to the display hook, whose format will be computed.
Returns
(format_dict, md_dict): dictformat_dict is a
dictwhose keys are valid MIME types and values are JSON'able raw data for that MIME type. It is recommended that all return values of this should always include the "text/plain" MIME type representation of the object. md_dict is adictwith the same MIME type keys of metadata associated with each output.
Aliases
-
IPython.core.displayhook.DisplayHook.compute_format_data