洪 民憙 (Hong Minhee) :nonbinary:'s avatar
洪 民憙 (Hong Minhee) :nonbinary:

@hongminhee@hollo.social · Reply to Wartezimmer's post

@Kaesekuchen Honestly, yes, it's global state… just scoped per thread/task. The advantage over a plain global is that you get isolation across concurrent requests without threading values through every call. The debugging experience with contextvars was rough in my memory, though I haven't used it in a while. Statically typed implicits feel safer to me because they desugar to actual arguments, so the compiler keeps track. The footgun either way is that context-dependent functions proliferate silently and become hard to refactor out.