What type represents typing.Any except None?

Viewed 331

I would like to annotate a variable such as it can be of any value except None, something like:

x: typing.Required(typing.Any) = 42

The typing module has the Union function, but there is no counterpart that would allow to exclude.

0 Answers
Related