Liran Nuna <liran...@gmail.com> added the comment:

> That's still doable with contextvars. You just need a custom mock-like object 
> (or library) that stores its settings/state in a context variable.

contextvars only work with asyncio, what about the iterator case?

In addition, you can't possibly expect authors to re-implement a library just 
because it may or may not be used with asyncio. In my example, re-implementing 
mock/patch is quite a task just to get such basic functionality.

In other words, contextvars don't solve this issue, it just creates new issues 
to solve and causes code duplication.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33918>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to