Cool. Won't it break if a function is "pure" from the practical point of view but in fact uses some variables (e.g. configuration parameters) declared outside of it?
Yes, that's what I mean but I'm not sure from the theoretical point of view. I used to believe a truly pure function isn't mean to access anything but what is passed to it as an argument so it makes me wonder what a particular implementation may expect. Whether or not this is Ok can also depend on a particular language runtime or library (and I'm far from an expert in the Python VM internals so far) - it can be impossible or quirky for a function executed asynchronously to access something that belongs to outside of it.