Extract ... from Tuple{...} and verify fixed length



What is the canonical way of extracting the parameters of a Tuple, and verifying that it has fixed length? Using advice I got in another topic, I am now using


Extract the parameters of a Tuple and verify that they have a fixed length.
function extract_Tuple_fixed(T::Type{<: Tuple})
    p = tuple(T.parameters...)
    @assert !(p[end] <: Vararg) "Not a tuple of fixed length."

which works:

julia> extract_Tuple_fixed(Tuple{Int,Int})
(Int64, Int64)

julia> extract_Tuple_fixed(NTuple{4,Int})
(Int64, Int64, Int64, Int64)

julia> extract_Tuple_fixed(Tuple{Int,Vararg{Int}})
ERROR: AssertionError: Not a tuple of fixed length.
 [1] extract_Tuple_fixed(::Type{Tuple{Int64,Vararg{Int64,N} where N}}) at ./REPL[83

but I am wondering if there is something neater, eg with a parametric function-template

this_does_not_work(::Type{Tuple{T...}}) = T


Update: Base.isvatuple can do the test. T.parameters still looks like the best way to extract the type parameters.