<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 2, 2017, at 1:58 PM, Rocky Wei via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi Chris and everyone else,</div><div class=""><br class=""></div>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?<br class=""><br class=""><a href="https://github.com/PerfectlySoft/Perfect-Python" class="">https://github.com/PerfectlySoft/Perfect-Python</a></div></div></blockquote><br class=""></div><div>Cool, I wasn’t aware of this. &nbsp;It looks like a straight-forward wrapper for the Python C API. &nbsp;</div><div><br class=""></div><div>Here are some random questions:</div><div><br class=""></div><div>why do you make the conversions from Python types to Swift types non-failable? &nbsp;This init I’d expect to be failable, for example:</div><div><a href="https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L34" class="">https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L34</a></div><div><br class=""></div><div><br class=""></div><div>I understand that you’re wrapping PyObject* with a class to get ARC behavior, but why make it “open”? &nbsp;What does subclassability mean for your PyObj type?</div><div><a href="https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L183" class="">https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L183</a></div><div><br class=""></div><br class=""><div class="">Why do you print errors when you throw, instead of including the details in the error that gets thrown?</div><div class=""><a href="https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L223" class="">https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L223</a></div><div class=""><br class=""></div><div class="">Why include a fixed list of supported types, instead of using a protocol to make it extensible?</div><div class=""><a href="https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L260" class="">https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L260</a></div><div class=""><br class=""></div><div class="">What’s this defer doing?</div><div class=""><a href="https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L423" class="">https://github.com/PerfectlySoft/Perfect-Python/blob/master/Sources/PerfectPython/PerfectPython.swift#L423</a></div><div class=""><br class=""></div><div class="">-Chris</div><div class=""><br class=""></div></body></html>