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

Better handling of global Gap instance #5

Open
embray opened this issue Jan 18, 2021 · 0 comments
Open

Better handling of global Gap instance #5

embray opened this issue Jan 18, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@embray
Copy link
Owner

embray commented Jan 18, 2021

The Gap class is the core wrapper class for accessing the GAP interpreter. Only one instance can be used at a time, for now, since only one GAP interpreter instance can exist in a single process. The default Gap instance gappy.gap is instantiated with some default parameters that will work in many cases. However, it's possible to instantiate one's own instance with different parameters by instantiating a Gap in the normal way. See 640dac6

As d66f403 points out, if a custom Gap is instantiated it's no longer possible to use the default gap.

I would prefer that Gap were a singleton, and that gappy.gap always points to the active instance. Calling Gap() will only update the initialization arguments in the case where the default instance has not already instantiated the GAP interpreter.

OTOH, maybe it should remain possible to have multiple simultaneous Gap instances, in case it's ever possible to have multiple GAP sub-interpreters. I don't know if/when that will ever be possible though.

@embray embray added the enhancement New feature or request label Jan 18, 2021
embray added a commit that referenced this issue Jan 21, 2021
the Gap instance being called.

Until and unless there is a good solution to #5 this is necessary, so
that classes implementing _gap_ don't need to rely on the global
singleton.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant