Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add default constructors for AbstractRange #48894

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

putianyi889
Copy link
Contributor

@putianyi889 putianyi889 commented Mar 4, 2023

Copy link
Sponsor Member

@inkydragon inkydragon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to add constructors for abstract types?

julia> methods(AbstractRange)
# 0 methods for type constructor

julia> supertype(AbstractRange)
AbstractVector (alias for AbstractArray{T, 1} where T)

julia>  methods(AbstractVector)
# 0 methods for type constructor

julia> supertype(AbstractVector)
Any

@inkydragon inkydragon added the domain:ranges Everything AbstractRange label Mar 10, 2023
@putianyi889
Copy link
Contributor Author

As you can see from added tests, it does eltype conversion for general ranges.
AbstractArray has constructors.

putianyi889 added a commit to putianyi889/PTYQoL.jl that referenced this pull request Nov 5, 2023
@vtjnash vtjnash added the status:forget me not PRs that one wants to make sure aren't forgotten label Mar 21, 2024
@jishnub
Copy link
Contributor

jishnub commented Mar 22, 2024

@putianyi889 This seems like a good idea. Is this ready from your side?
We would probably want more tests.

@putianyi889
Copy link
Contributor Author

Is this ready from your side?

confirm.

We would probably want more tests.

not sure how many. maybe add 2-3 segments to every conversion test?

test/ranges.jl Outdated Show resolved Hide resolved
Co-authored-by: Sheehan Olver <solver@mac.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:ranges Everything AbstractRange status:forget me not PRs that one wants to make sure aren't forgotten
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants