MCPcopy Index your code
hub / github.com/ipython/ipython / __call__

Method __call__

IPython/core/formatters.py:393–409  ·  view source on GitHub ↗

Compute the format for an object.

(self, obj)

Source from the content-addressed store, hash-verified

391
392 @catch_format_error
393 def __call__(self, obj):
394 """Compute the format for an object."""
395 if self.enabled:
396 # lookup registered printer
397 try:
398 printer = self.lookup(obj)
399 except KeyError:
400 pass
401 else:
402 return printer(obj)
403 # Finally look for special method names
404 method = get_real_method(obj, self.print_method)
405 if method is not None:
406 return method()
407 return None
408 else:
409 return None
410
411 def __contains__(self, typ):
412 """map in to lookup_by_type"""

Callers

nothing calls this directly

Calls 2

lookupMethod · 0.95
get_real_methodFunction · 0.85

Tested by

no test coverage detected