# Julia from the perspective of a pythonista

**URL:** https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956
**Category:** General Usage
**Tags:** feedback
**Created:** [February 24, 2021, 7:45pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956 "2021-02-24T19:45:59Z")
**Posts on this page:** 1
**Showing post:** 78

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [February 25, 2021, 6:02pm UTC](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956/78 "2021-02-25T18:02:48Z")

</div>

> [@Jake](#):
>
> AbstractVector{\<:Real} and Vector{\<:Real}

Probably that should be split in a new topic. But if you use `AbstractVector` your function will accept, for example, `views`, `StaticArrays`, and other array types which are not `Vectors` in the strict sense:

```julia
julia> f(x::Vector) = 1
f (generic function with 1 method)

julia> g(x::AbstractVector) = 1
g (generic function with 1 method)

julia> x = [1,2,3];

julia> f(@view x[1:2])
ERROR: MethodError: no method matching f(::SubArray{Int64,1,Array{Int64,1},Tuple{UnitRange{Int64}},true})
Closest candidates are:
  f(::Array{T,1} where T) at REPL[1]:1
Stacktrace:
 [1] top-level scope at REPL[3]:1

julia> g(@view x[1:2])
1

julia> using StaticArrays

julia> x = zeros(SVector{3,Float64});

julia> f(x)
ERROR: MethodError: no method matching f(::SArray{Tuple{3},Float64,1,3})
Closest candidates are:
  f(::Array{T,1} where T) at REPL[1]:1
Stacktrace:
 [1] top-level scope at REPL[8]:1

julia> g(x)
1

```

Concerning `Real` vs. `<:Real` I like [my way](https://discourse.julialang.org/t/why-isa-x-1-y-1-array-tuple-stuff-number-1-false/55777/6) to explain this, for obvious reasons.

---

_[View the full topic](https://discourse.julialang.org/t/julia-from-the-perspective-of-a-pythonista/55956)._
