dabeaz / curio

Good Curio!
Other
4.01k stars 240 forks source link

Add contextvar support. #276

Closed Fuyukai closed 5 years ago

Fuyukai commented 5 years ago

Should work as expected on <3.7.

dabeaz commented 5 years ago

Do you think that contextvars should simply be enabled and always supported when available? Or should it be an optional feature that's turned on if requested?

(I'm not sure I have a strong opinion either way. Just brain dumping here).

imrn commented 5 years ago

Does it have anything to do with maintaining current_taak?

Fuyukai commented 5 years ago

I personally think that they should be enabled and supported always, as it means there's no extra requirement for an app to use them other than use 3.7 or depend on contextvars for <3.6, instead of having to turn them on yourself (also can interact with libraries weirdly).

dabeaz commented 5 years ago

Ok, I'm sold!

dabeaz commented 5 years ago

I had to revert this pull request since it broke some stuff with async threads. I'm going to revisit this, but the implementation will be different.