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.
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.