The only way I could start working on this if I quit my job, but that might not be very ethical thing to do. Any advice what should I do? What would you do?
1 karma · joined July 1, 2023
The only way I could start working on this if I quit my job, but that might not be very ethical thing to do. Any advice what should I do? What would you do?
class Api(AsyncApi):
def __init__(self, token):
try:
self._loop = asyncio.get_event_loop()
except RuntimeError:
# when running in a thread, get_event_loop doesn't create another one
self._loop = asyncio.new_event_loop()
asyncio.set_event_loop(self._loop)
self._session = aiohttp.ClientSession(loop=self._loop)
super().__init__(token, self._loop, self._session)
@lru_cache(maxsize=None)
def __getattribute__(self, name):
attr = super().__getattribute__(name)
if name.startswith("_") or not asyncio.iscoroutinefunction(attr):
return attr
def call_sync(*args, **kwargs):
coro = attr(*args, **kwargs)
return self._loop.run_until_complete(coro)
return call_sync
It can run when there is no loop or even when a loop is already running. Unless you already know your users will want man pages, I wouldn’t bother also outputting them as they just aren’t used often enough anymore.
I don't know where this is coming from, me and my colleagues are reading man pages every day. I would be interested how much others read them.To put another way; I HATE git, I LOVE Mercurial, but Git won, it's ubiquitous and Mercurial is not that much better.
Almost everyone is using Git nowadays, so the rest should use Git also, yes, instead of wasting brain cycles, even worse huge efforts to support Mercurial instead of improving existing features in GitLab.
I'm not at all against progress, innovation or opinions, but I hate complexity, wasted effort and somebody forcing me to learn yet another tool just because...
C is just terrible, it has to be improved, but the "Git vs Mercurial" is not the same topic, because Mercurial is not THAT MUCH better to worth to replace it or make thing more complex.