Skip to content

Make Contexts context managers#574

Closed
bgrant wants to merge 5 commits into
masterfrom
feature/contexts-are-context-managers
Closed

Make Contexts context managers#574
bgrant wants to merge 5 commits into
masterfrom
feature/contexts-are-context-managers

Conversation

@bgrant
Copy link
Copy Markdown
Contributor

@bgrant bgrant commented Aug 11, 2014

Based on #573, for convenience. Closes #558.

@bgrant bgrant added this to the 0.6 milestone Aug 11, 2014
@bgrant bgrant changed the title Feature/contexts are context managers Make Contexts context managers Aug 11, 2014
@kwmsmith
Copy link
Copy Markdown
Contributor

I'm on the fence about this one. Given that Context.close() is a no-op for an MPIContext, and we don't want to encourage the creation of many Contexts given their overhead, I'd prefer to wait until the need for this is clear.

@bgrant
Copy link
Copy Markdown
Contributor Author

bgrant commented Sep 1, 2014

So we're encouraging reusing Contexts instead of closing them?

Also, were you thinking of a new name for them?

@kwmsmith
Copy link
Copy Markdown
Contributor

Closing for now, based on discussions. Can re-evaluate later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Contexts should have __enter__ and __exit__ methods

2 participants