<div dir="ltr"><div><div>Intersection has already been proposed, see <a href="https://github.com/python/typing/issues/213">https://github.com/python/typing/issues/213</a><br></div>But it is not yet implemented. You can show your use cases on the typing issue tracker,</div><div>maybe they can be covered by Intersection (which will be most probably added at some point).<br><br>--<br></div>Ivan<br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 13 November 2017 at 20:32, Ilya Kulakov <span dir="ltr"><<a href="mailto:kulakov.ilya@gmail.com" target="_blank">kulakov.ilya@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I needed to declare a type that would mean "Any but None" and didn't find how.<div><br></div><div>Current implementation allows to expand set of allowed types, not narrow it.<div>Perhaps typing needs the rest of set operators in addition to Union?</div><br><br><div>
<div style="word-wrap:break-word"><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Best Regards,</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Ilya Kulakov</div></div>
</div>
<br></div></div><br>______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br>
<br></blockquote></div><br></div>