Complete typing.Union with the rest of set-like functions

I needed to declare a type that would mean "Any but None" and didn't find how. Current implementation allows to expand set of allowed types, not narrow it. Perhaps typing needs the rest of set operators in addition to Union? Best Regards, Ilya Kulakov

Intersection has already been proposed, see https://github.com/python/typing/issues/213 But it is not yet implemented. You can show your use cases on the typing issue tracker, maybe they can be covered by Intersection (which will be most probably added at some point). -- Ivan On 13 November 2017 at 20:32, Ilya Kulakov <kulakov.ilya@gmail.com> wrote:

Intersection has already been proposed, see https://github.com/python/typing/issues/213 But it is not yet implemented. You can show your use cases on the typing issue tracker, maybe they can be covered by Intersection (which will be most probably added at some point). -- Ivan On 13 November 2017 at 20:32, Ilya Kulakov <kulakov.ilya@gmail.com> wrote:
participants (2)
-
Ilya Kulakov
-
Ivan Levkivskyi