New improved "PEP 695 – Type Parameter Syntax" in Python, PEP mentions Julia

People might not be aware, but Python has (optional) static typing already, the new PEP expands the syntax and mentions Julia and a number of other languages:

4 Likes

It seems the type declarations in the PEP don’t actually work. This does:

struct StructB{Int <: T <: Number}
    x::T
end

and

julia> struct Container{Int <: T <: Number}
                  x::T
              end

julia> function func1(v::Container{T}) where {T <: Real}
       end
3 Likes