Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/pytest-dev/pytest
/ from_function
Method
from_function
src/_pytest/_code/code.py:67–68 ·
view source on GitHub ↗
(cls, obj: object)
Source
from the content-addressed store, hash-verified
65
66
@classmethod
67
def
from_function(cls, obj: object) -> Code:
68
return
cls(getrawcode(obj))
69
70
def
__eq__(self, other):
71
return
self.raw == other.raw
Callers
11
_traceback_filter
Method · 0.80
getfslineno
Function · 0.80
getmsg
Function · 0.80
test_code_from_function_with_class
Function · 0.80
test_code_fullsource
Function · 0.80
test_code_source
Function · 0.80
test_code_from_func
Function · 0.80
test_code_getargs
Function · 0.80
test_traceback_cut
Method · 0.80
test_getreprcrash
Method · 0.80
test_code_of_object_instance_with_call
Function · 0.80
Calls
2
getrawcode
Function · 0.90
cls
Function · 0.85
Tested by
9
getmsg
Function · 0.64
test_code_from_function_with_class
Function · 0.64
test_code_fullsource
Function · 0.64
test_code_source
Function · 0.64
test_code_from_func
Function · 0.64
test_code_getargs
Function · 0.64
test_traceback_cut
Method · 0.64
test_getreprcrash
Method · 0.64
test_code_of_object_instance_with_call
Function · 0.64