MCPcopy Index your code
hub / github.com/python/cpython / get_suggestion

Method get_suggestion

Lib/test/test_traceback.py:4137–4147  ·  view source on GitHub ↗
(self, obj, attr_name=None)

Source from the content-addressed store, hash-verified

4135 attr_function = getattr
4136
4137 def get_suggestion(self, obj, attr_name=None):
4138 if attr_name is not None:
4139 def callable():
4140 self.attr_function(obj, attr_name)
4141 else:
4142 callable = obj
4143
4144 result_lines = self.get_exception(
4145 callable, slice_start=-1, slice_end=None
4146 )
4147 return result_lines[0]
4148
4149
4150class BaseSuggestionTests(SuggestionFormattingTestMixin):

Calls 1

get_exceptionMethod · 0.45

Tested by

no test coverage detected