Why does Dates allow non-broadcasted arithmatic?

dates

#1

In the code for Dates there is the following:

# TimeType, AbstractArray{TimeType}
(-)(x::AbstractArray{T}, y::T) where {T<:TimeType} = x .- y
(-)(y::T, x::AbstractArray{T}) where {T<:TimeType} = y .- x

Is this intended? Was it some code to get around deprecation warnings for a period of time?


#2

I imagine this is just an oversight. It should be possible to deprecate it given that Dates is in stdlib. At least it’s worth filing an issue.


#3

For posterity, the issue is #28672.

Cheers,
Kevin