Please sign in to comment.
Add @dynamicCallable to PythonObject.
`PythonObject` now have the `@dynamicCallable` attribute. They define both the positional/keyword argument variants of the `dynamicallyCall` method. The previous `call` and `callMember` methods have been removed. To call a `PythonObject` with variadic arguments, one can use the dynamic call sugar: `a(1, 2, 3)`. To call with an array of arguments, one can use a direct call: ``` let arguments: [Int] = [1, 2, 3] a.dynamicallyCall(with: arguments) ``` Note: It is not possible to call a `PythonObject` with a non-literal dictionary of arguments. Todo: Reconsider how to expose throwing calls. `ThrowingPythonObject` does not have the `@dynamicCallable` attribute because `x.throwing(0, 1, 2)` is confusing. PiperOrigin-RevId: 197981249
- Loading branch information...
Showing with 111 additions and 154 deletions.
Oops, something went wrong.