PEP 550. Early thinking about how Python handles context in concurrent programs.

github.com/gvanrossum/pep550

Vaya's read on this project

Problem, audience, market, and the verdict — sign in to see it.

Updates

December 2017
  • Make AbstractContext subclass (immutable) Mapping, make _setitem, _de…
  • Remove ContextVar.delete()
  • Add Token class, returned from set(), can be used by reset()
October 2017
  • Rename set_ctx to _set_ctx
  • Add proposed Context.run() function
  • Add get(default=<value>)
  • A (much) simpler model
September 2017
  • Add ContextVar.get_stack() (#3)
  • Rename ContextVar.setx() -> ContextVar.set()
  • Rename ContextVar.setx() -> ContextVar.set()
  • Refactor run() stuff again
  • Fix --disallow-any flags (there must only be one)
  • Be stricter in types. Add Makefile so we can write 'make mypy'
  • ContextVar needs only one type parameter.
  • Few updates after discussion
  • Add some text (scratchpad)
  • Make ContextVar.get() raise a LookupError
  • Renames: FrozenDict -> LocalContext; LocalContext -> ContextHolder
  • Precompute depth
  • Refactor run() methods/functions