Silence some more warnings on clang
I put this changes on a MR as they can potentially produce some side effects
- Remove
this
from Lambdas capture that does not use it. - Remove call to deprecated Python
PyEval_InitThreads()
. this is deprecated since Python 3.6, but only in 3.9 does nothing. In 3.7 and above the function is called after callingPy_Initialize()
. I could not find information if it also gets called when usingPy_InitializeEx()
(our case) https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads - On foreach avoid copying the object and use reference. this does not seem dangerous as the object is only read.