Skip to content

Avoid serializing functions #467

Open
@odashi

Description

@odashi

Current serialization attempt to serialize functions via inspect.getsource:

elif callable(data):
return getsource(data)

However, this function supports only limited cases: given callables have to be represented as a substantial source, and builtin/synthesized functions can't be supported. Basically we don't have complete way to serialize functions.

In addition, storing runnable code to loadable data is dangerous because it opens a door to attack the system. If we don't have any special demands, it is better to avoid this functionality from the codebase.

RFC: @neubig

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions