MCPcopy Index your code
hub / github.com/apache/fory / write

Method write

python/pyfory/serializer.py:1601–1611  ·  view source on GitHub ↗
(self, write_context, func)

Source from the content-addressed store, hash-verified

1599
1600class NativeFuncMethodSerializer(Serializer):
1601 def write(self, write_context, func):
1602 name = func.__name__
1603 write_context.write_string(name)
1604 obj = getattr(func, "__self__", None)
1605 if obj is None or inspect.ismodule(obj):
1606 write_context.write_bool(True)
1607 module = func.__module__
1608 write_context.write_string(module)
1609 else:
1610 write_context.write_bool(False)
1611 write_context.write_ref(obj)
1612
1613 def read(self, read_context):
1614 name = read_context.read_string()

Callers

nothing calls this directly

Calls 3

write_refMethod · 0.80
write_stringMethod · 0.45
write_boolMethod · 0.45

Tested by

no test coverage detected