RFC – ergonomic juliacall syntax for passing Python variables to Julia

The Julia code is defining a function in that example, so why not just make INV_COV_MATRIX a parameter of your Julia function? Using globals to pass data to functions is an anti-pattern.

(Even if you then want to pass the function to another function that doesn’t expect the extra parameter, that’s what closures are for, e.g. you pass lambda tree, dataset, options: custom_loss(tree, dataset, options, inv_cov).)