Simplify Python code by passing tuples to C by radarhere · Pull Request #8733 · python-pillow/Pillow
Navigation Menu
{{ message }}
python-pillow / Pillow Public
- Notifications You must be signed in to change notification settings
- Fork 2.4k
Merged
Simplify Python code by passing tuples to C#8733
hugovk merged 2 commits intopython-pillow:mainfrom
Simplify Python code by passing tuples to C#8733
hugovk merged 2 commits intopython-pillow:mainfrom
Conversation
Copy link Copy Markdown
Member
radarhere
commented
Feb 5, 2025
radarhere
commented
In code like the following
Pillow/src/PIL/WebPImagePlugin.py
Lines 225 to 227 in 2810d7c
| enc = _webp.WebPAnimEncoder( | |
| im.size[0], | |
| im.size[1], |
there is no need to split the im.size tuple into multiple parts before passing it to C. We can pass just im.size by adjusting
Lines 165 to 169 in 2810d7c
| if (!PyArg_ParseTuple( | |
| args, | |
| "iiIiiiiii", | |
| &width, | |
| &height, |
to receive a tuple.
radarhere
added
the
Cleanup
label
radarhere added 2 commits
February 5, 2025 19:12
radarhere
force-pushed
the
tuple
branch
from
5f227f8 to
a37702d
Compare
hugovk
merged commit
c73796d
into
python-pillow:main
radarhere
deleted the
tuple
branch
radarhere added a commit to radarhere/Pillow that referenced this pull request
Feb 6, 2025radarhere added a commit to radarhere/Pillow that referenced this pull request
Feb 7, 2025This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment