Hey, I'm trying to store a "0 kwargs" object. I.e. the result of ((;k...) -> k)()
. I see the type is Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}()
, but that seems to be uninstantiable. The closest I could get was Base.Pairs(NamedTuple(),())
but that gives Base.Pairs{Union{}, ...
instead of `Base.Pairs{Symbol, ...
.
Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}(NamedTuple(),())
works, no?
It's an immutable (and also is a singleton). So, why not just do const NOKWARGS = ((;k...) -> k)()
and use it where you need it?
Last updated: Oct 02 2023 at 04:34 UTC