@staticmethod<EOL><INDENT>def create(desired_type: Type[Any], contents_dict: Dict, caught: Exception):<DEDENT>
msg = '<STR_LIT>' + str(desired_type) + '<STR_LIT>'+ '<STR_LIT>' + caught.__class__.__name__ + '<STR_LIT>' + str(caught) + '<STR_LIT:\n>'<EOL>try:<EOL><INDENT>from pprint import pformat<EOL>msg += '<STR_LIT>' + pformat(contents_dict)<EOL><DEDENT>except:<EOL><INDENT>msg += '<STR_LIT>' + str(contents_dict)<EOL><DEDENT>return CaughtTypeErrorDuringInstantiation(msg).with_traceback(caught.__traceback__)<EOL>
Helper method provided because we actually can't put that in the constructor, it creates a bug in Nose tests
https://github.com/nose-devs/nose/issues/725

:param desired_type:
:param contents_dict:
:param caught:
:return: