add Context manager and default context under threading
This implements https://github.com/inducer/islpy/issues/22
Semantics of context pushing is added as a test case.
With this change:
-
DEFAULT_CONTEXTis deprecated (with a warning) in favor ofget_default_context() -
get_default_context()always returns a thread unique default context for the first call in a thread. -
push_context(ctx=none)can be used to push new default context(s), which allows for custom default Context. - Context now implements
__copy__and__deepcopy__which always returns the identity.
I have put TODO_VERSION everywhere in the docs. Please take a look and change them to something appropriate?
Update islpy/__init__.py
Please have proper commit messages.
(OK to leave these, just for the future.)
Sorry, I believe they were generated automatically by GitHub. I will definitely note this in the future.
Sorry, I believe they were generated automatically by GitHub.
They are, but you have the option to change them when you click "Commit".