File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -1550,14 +1550,27 @@ public struct PythonFunction {
15501550 return try fn ( argumentsAsTuple [ 0 ] )
15511551 }
15521552 }
1553+
1554+ public init ( _ fn: @escaping ( PythonObject ) throws -> Void ) {
1555+ function = PyFunction { argumentsAsTuple in
1556+ try fn ( argumentsAsTuple [ 0 ] )
1557+ return Python . None
1558+ }
1559+ }
15531560
15541561 /// For cases where the Swift function should accept more (or less) than one parameter, accept an ordered array of all arguments instead
15551562 public init ( _ fn: @escaping ( [ PythonObject ] ) throws -> PythonConvertible ) {
15561563 function = PyFunction { argumentsAsTuple in
15571564 return try fn ( argumentsAsTuple. map { $0 } )
15581565 }
15591566 }
1560-
1567+
1568+ public init ( _ fn: @escaping ( [ PythonObject ] ) throws -> Void ) {
1569+ function = PyFunction { argumentsAsTuple in
1570+ try fn ( argumentsAsTuple. map { $0 } )
1571+ return Python . None
1572+ }
1573+ }
15611574}
15621575
15631576extension PythonFunction : PythonConvertible {
You can’t perform that action at this time.
0 commit comments