Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize the handling of symbol resolution #10

Open
nthiery opened this issue Feb 21, 2018 · 1 comment
Open

Generalize the handling of symbol resolution #10

nthiery opened this issue Feb 21, 2018 · 1 comment

Comments

@nthiery
Copy link
Collaborator

nthiery commented Feb 21, 2018

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.

@nthiery
Copy link
Collaborator Author

nthiery commented Feb 21, 2018

cc: @florian-rabe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant