-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 tp_richcompare handler for Imaging_Type/ImagingCore #7260
base: main
Are you sure you want to change the base?
Conversation
Valgrind is currently failing - https://github.com/python-pillow/Pillow/actions/runs/5460694184/jobs/9937936242?pr=7260 Also, I went to test the speed of image equality with this, radarhere@98e02aa... and found https://github.com/radarhere/Pillow/actions/runs/5461893489/jobs/9940492884#step:8:4787
|
oops, Py_NewRef wasn't added until Python 3.10. |
bbf5370
to
7eba51c
Compare
0e86ed9
to
17faca4
Compare
1f8077d
to
d8012b3
Compare
f481c3c
to
97a08ff
Compare
ff49d68
to
5322aaa
Compare
Py_True and Py_False were only made immortal in Python 3.12, so we have to properly increment their refcount for versions before that.
for more information, see https://pre-commit.ci
Imaging_Type/ImagingCore is exposed by Image.getdata(), so this allows you to properly compare the result of that method without it being an identity comparison. This should also speed up comparison between Image objects, because now the comparison is done in C instead of passing the data back to Python for it to be compared.