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 iterator for method specializations #49116

Merged
merged 5 commits into from
Mar 30, 2023
Merged

Conversation

timholy
Copy link
Member

@timholy timholy commented Mar 23, 2023

There have been longstanding reasons to want an API for extracting all extant specializations of a method, but this is even more true after #49071.

There have been longstanding reasons to want an API for extracting
all extant specializations of a method, but this is even more
true after #49071.
@timholy timholy requested a review from vtjnash March 23, 2023 12:34
@timholy
Copy link
Member Author

timholy commented Mar 23, 2023

Since the fix in MethodAnalysis was straightforward, I thought it would be better to introduce an iterator interface, as I think more packages would find it easy to use.

base/reflection.jl Outdated Show resolved Hide resolved
@jakobnissen
Copy link
Contributor

I think it would be nice if length was implemented for it - iterators default to HasLength(), which requires length to be implemented.

timholy and others added 2 commits March 23, 2023 10:25
Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com>
base/reflection.jl Outdated Show resolved Hide resolved
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

SGTM

@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Mar 28, 2023
@timholy timholy merged commit da1ce65 into master Mar 30, 2023
@timholy timholy deleted the teh/specializations_api branch March 30, 2023 09:31
@giordano giordano removed the merge me PR is reviewed. Merge when all tests are passing label Apr 11, 2023
Xnartharax pushed a commit to Xnartharax/julia that referenced this pull request Apr 19, 2023
There have been longstanding reasons to want an API for extracting
all extant specializations of a method, but this is even more
true after JuliaLang#49071.

Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com>
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants