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

Use new() instead of Image()._new() #7460

Merged
merged 1 commit into from
Oct 13, 2023
Merged

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Oct 13, 2023

trns_im = Image()._new(core.new(self.mode, (1, 1)))

can be replaced with

trns_im = new(self.mode, (1, 1))

because that is what new() would do in this case.

This requires variables called new to be renamed in the surrounding code to avoid overlap, but that sounds like a good idea anyway.

@hugovk hugovk merged commit 5666c05 into python-pillow:main Oct 13, 2023
50 checks passed
@radarhere radarhere deleted the new branch October 13, 2023 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants