<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 Dec 7, 2017, at 9:20 AM, BJ Homer via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="Singleton" style="word-wrap: break-word; -webkit-nbsp-mode: space;"><div class=""><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div class="" style="word-wrap: break-word;"><div class=""><div class="">So while it’s theoretically possible to do this, I don’t think it’s a concern in practice. The incentives are already in place to encourage doing the “right” thing in this case, even with the possibility of dynamic member lookup.</div><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class="">-BJ</div></font></span></div></div></blockquote><div class=""><br class=""></div><div class="">Hey, thanks for answering that part of the concern. i also came to this point, but wondered if the dictionary couldn't be made of type [String: DynamicValue] where DynamicValue would have some way to be automatically casted to string, int, etc, by reusing the same mechanism that the proposal would use to convert PyVal to regular swift types. I stopped at this point.<br class=""></div></div><br class=""></div></div></div></blockquote></div><div class=""><br class=""></div><div class="">As far as I am aware, the proposal provides no mechanism for automatically converting back from PyVal to regular Swift types. You would have to do something explicit like<span class="Apple-converted-space"> </span><font face="Menlo" class="">myPythonValue.intValue</font>, or<span class="Apple-converted-space"> </span><font face="Menlo" class="">String(myPythonValue)</font>.</div></div></div></blockquote><br class=""></div><div>That is correct, these proposals have nothing to do with conversions like that.</div><div><br class=""></div><div>If you look at the Python prototype I sent out, the primitive types like Int/String/etc have failable conversion from PyVal (they return an optional).</div><div><br class=""></div><div>-Chris</div><div><br class=""></div></body></html>