> On Nov 2, 2017, at 1:58 PM, Rocky Wei via swift-evolution > <swift-evolution@swift.org> wrote: > > Hi Chris and everyone else, > > So PerfectlySoft made Perfect-Python months ago to help Swift import python > objects and libraries. However, it may reduce the strong type checking. Any > idea to avoid it? > > https://github.com/PerfectlySoft/Perfect-Python > <https://github.com/PerfectlySoft/Perfect-Python> Cool, I wasn’t aware of this. It looks like a straight-forward wrapper for the Python C API.
Here are some random questions: why do you make the conversions from Python types to Swift types non-failable? This init I’d expect to be failable, for example: https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L34 <https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L34> I understand that you’re wrapping PyObject* with a class to get ARC behavior, but why make it “open”? What does subclassability mean for your PyObj type? https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L183 Why do you print errors when you throw, instead of including the details in the error that gets thrown? https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L223 <https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L223> Why include a fixed list of supported types, instead of using a protocol to make it extensible? https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L260 <https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L260> What’s this defer doing? https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L423 <https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L423> -Chris
_______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution