Tinche / aiofiles

File support for asyncio
Apache License 2.0
2.76k stars 150 forks source link

What is the purpose of binding each file to a particular loop? #153

Closed rhelmot closed 1 year ago

rhelmot commented 1 year ago

It's somewhat inconvenient that AsyncBase._loop exists - it makes it hard to implement a global stdout object via a module-level stdout = aiofiles.threadpool.wrap(sys.stdout). What is the purpose of this attribute? If it is purely for performance reasons, would you accept a PR that changed all references to self._loop to self._loop or asyncio.get_running_loop()?

Tinche commented 1 year ago

I don't remember, it's been a long time.

I wouldn't mind merging a thought-out PR if it solves your problem.