Infinities.jl icon indicating copy to clipboard operation
Infinities.jl copied to clipboard

Potentially problematic method definition

Open jishnub opened this issue 2 years ago • 1 comments

https://github.com/JuliaMath/Infinities.jl/blob/489b68b594f436f6b068c222939c9f537d20b928/src/cardinality.jl#L192

Aqua flags this method as potential type-piracy (see https://github.com/JuliaTesting/Aqua.jl/issues/173). I think this is fine, and the flag is a false positive, but why do we need this method? Is a real infinity used as an array size or index, as opposed to the integer ℵ₀?

jishnub avatar Dec 01 '23 06:12 jishnub

It is indeed a false positive as all potential ambiguities have more restricted definitions eg

julia> @which Base.to_shape((),)
to_shape(::Tuple{})
     @ Base abstractarray.jl:851

Is a real infinity used as an array size or index, as opposed to the integer ℵ₀?

This is possibly just outdated code (it used to be the case that ∞ isa Integer hence played the role of ℵ₀). Alternatively it was to support a[∞] instead of a[ℵ₀].

Try deleting it and see if anything breaks?

dlfivefifty avatar Dec 01 '23 17:12 dlfivefifty