100%. I code like OP and find it much easy to understand. The latter could be well structured but a novice coder like me needs comments to understand it.
The second snippet of code seems to come from a template. Perhaps your colleague had already worked on on a similar problem before (e.g., python code to runs processes)?
Perhaps, shall check with him! But this is only one example, there’s a lot of other places as well. In case you’re interested to see more the project we’re working on is https://github.com/plexe-ai/smolmodels
To set some context: The code handles isolated execution of machine learning code.
Original version:
New version: