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

pymodule: remove call_function etc. #1492

Merged
merged 1 commit into from
Mar 14, 2021

Conversation

davidhewitt
Copy link
Member

So on master we renamed PyModule::call to PyModule::call_function etc. in #1467

But this is causing confusion to a user unfamiilar with the project in #1476 .

So I suggest we just remove PyModule::call_function and instead point users to use .getattr(...)?.call(). There's no optimization in PyModule::call_function etc., so I think there's no reason we need to offer these APIs.

I also deprecated PyModule::get because it's just a dumb wrapper around PyAny::getattr, by the same logic.

@davidhewitt
Copy link
Member Author

cc @birkenfeld

src/types/module.rs Outdated Show resolved Hide resolved
tests/test_datetime.rs Outdated Show resolved Hide resolved
@birkenfeld
Copy link
Member

birkenfeld commented Mar 13, 2021

Whoops, should not have been "approve" yet.

@davidhewitt davidhewitt force-pushed the no-pymodule-call-function branch 3 times, most recently from 2297e43 to e872635 Compare March 13, 2021 22:55
Copy link
Member

@kngwyu kngwyu left a comment

Choose a reason for hiding this comment

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

Thanks!

@davidhewitt davidhewitt merged commit 6ab61a1 into PyO3:master Mar 14, 2021
@davidhewitt davidhewitt deleted the no-pymodule-call-function branch March 14, 2021 12:50
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.

4 participants