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

Define parentmodule(::Method) #47548

Merged
merged 1 commit into from
Nov 15, 2022
Merged

Define parentmodule(::Method) #47548

merged 1 commit into from
Nov 15, 2022

Conversation

ararslan
Copy link
Member

Among the methods of parentmodule is one that looks for a matching method and retrieves the parent module of that method. However, there was no method of parentmodule for Methods themselves. The change made here introduces such a method and modifies code elsewhere to make use of it. It also updates the docstring for parentmodule(f, types) to note that it returns the first matching method, not the matching method.

Among the methods of `parentmodule` is one that looks for a matching
method and retrieves the parent module of that method. However, there
was no method of `parentmodule` for `Method`s themselves. The change
made here introduces such a method and modifies code elsewhere to make
use of it.
@JeffBezanson JeffBezanson merged commit 9413050 into master Nov 15, 2022
@JeffBezanson JeffBezanson deleted the aa/parentmodule-method branch November 15, 2022 23:29
@JeffBezanson
Copy link
Sponsor Member

it returns the first matching method, not the matching method.

Good to fix the doc string, but this seems like a strange behavior. It should probably be equivalent to parentmodule(which(f, types)) (which throws an error if there isn't a unique match).

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.

2 participants