<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;">On Aug 17, 2014, at 2:33 AM, Greg Ewing <<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>> wrote:<br><div><br class="Apple-interchange-newline"><blockquote type="cite">Stefan Behnel wrote:<br><blockquote type="cite">However, it does not support protocols, so it still needs<br>something that allows us to say Iterable(int) in some way.<br></blockquote><br>Just had a thought -- does mypy provide a way to express<br>a type that supports more than one protocol? E.g. can you<br>say that something must be both Iterable and Hashable?<br></blockquote><br></div><div>That would be union types. Current syntax:</div><div>Union[Iterable[int], Hashable]</div><div><br></div><div>Proposed more concise syntax:</div><div>Iterable[int] | Hashable</div><br><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">-- <br>Best regards,<br>Ćukasz Langa<br><br>WWW: <a href="http://lukasz.langa.pl/">http://lukasz.langa.pl/</a><br>Twitter: @llanga<br>IRC: ambv on #python-dev</div>
</div>
<br></body></html>