I have a suggested change to the Noteworthy differences from Python page in the documentation but thought a discussion would be appropriate first since I’m not a Julia expert.
For me, one of the key differences between Julia and Python is that Julia has a built-in syntax for array literals. This does not come across clearly on this page. Arrays are mentioned in this bullet point about Lists:
- Python Lists—flexible but slow—correspond to the Julia
Vector{Any}
type or more generallyVector{T}
whereT
is some non-concrete element type. “Fast” arrays like Numpy arrays that store elements in-place (i.e.,dtype
isnp.float64
,[('f1', np.uint64), ('f2', np.int32)]
, etc.) can be represented byArray{T}
whereT
is a concrete, immutable element type. This includes built-in types likeFloat64
,Int32
,Int64
but also more complex types likeTuple{UInt64,Float64}
and many user-defined types as well.
but I don’t think this does them justice.
My suggestion is to take the second statement from this bullet (starting ““Fast” arrays like Numpy…”) and make it a separate bullet point about arrays and include some examples of array literals. For example, the special syntax for one and 2-dimensional arrays (borrowed from Matlab I believe):
a = [1 2 3; 4 5 6] # 2×3 Array{Int64,2}:
a = [1, 2, 3, 4, 5, 6] # 6-element Array{Int64,1}
What do people think?