Skip to content

Generalize the handling of symbol resolution #10

@nthiery

Description

@nthiery

Currently one can register a callback for converting to Python an OpenMath symbol, based on cd and name.
A more general mechanism would be to support registering callbacks based on:

  • cdbase, cd, and name
  • cdbase and cd
  • cdbase
  • nothing (defining a default callback)

Taking the cdbase into account is required anyway by the OpenMath standard.
The others are practical in situations where all symbols in a given context (cd, cdbase) are handled identically, typically by loading the eponymous global Python object / functions.

Practical use case: in the pickle-based serialization, Florian recommends using a plain OMS symbol to represent a global Python objects; something like:

   <OMS cdbase=python cd=sagemath name=sage.foo.bar.baz/>

In that case, having to register all symbols would be unpractical.

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