islpy icon indicating copy to clipboard operation
islpy copied to clipboard

add Context manager and default context under threading

Open thisiscam opened this issue 5 years ago • 5 comments

This implements https://github.com/inducer/islpy/issues/22

Semantics of context pushing is added as a test case.

With this change:

  • DEFAULT_CONTEXT is deprecated (with a warning) in favor of get_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.

thisiscam avatar Oct 17 '20 05:10 thisiscam

I have put TODO_VERSION everywhere in the docs. Please take a look and change them to something appropriate?

thisiscam avatar Oct 19 '20 06:10 thisiscam

Update islpy/__init__.py

Please have proper commit messages.

inducer avatar Oct 19 '20 17:10 inducer

(OK to leave these, just for the future.)

inducer avatar Oct 19 '20 17:10 inducer

Sorry, I believe they were generated automatically by GitHub. I will definitely note this in the future.

thisiscam avatar Oct 19 '20 17:10 thisiscam

Sorry, I believe they were generated automatically by GitHub.

They are, but you have the option to change them when you click "Commit".

inducer avatar Oct 19 '20 17:10 inducer