-
-
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
API changes for Resampling modes #6537
Comments
To provide context, the deprecations being discussed were added in #5954. The intention was not to make an arbitrary change, but to make use of a newish Python language feature, enums.
They were first deprecated in Pillow 9.1.0 - https://pillow.readthedocs.io/en/stable/releasenotes/9.1.0.html#deprecations |
I think in the scheme of things, this is a very minor change for users to make when upgrading to a new version. In Javascript programming, I'm used to finding old npm packages abandoned and replaced with new ones, and in iOS programming, I'd be surprised if Apple went a year without changing any constants. If your argument is that Pillow is extremely widely used, I'll try and use NumPy as a point of reference. That is another Python library, downloaded twice as much as Pillow. In NumPy 1.20.0, they deprecated a series of aliases. https://grep.app/search?q=np.int seems to show that at least 20 times the amount of code is affected by that compared to https://grep.app/search?q=Image.BILINEAR. I make this comment not in the interest of taking a stance, but in the interest of giving you a quick response. |
I believe that the argument for deprecating inbuilt types in NumPy is a bit stronger since it was know for a long time to be an actual problem numpy/numpy#6103
The usage of a new Python language feature does not sound like a very convincing argument to me. Also, it is not an argument for breaking backwards compatibility.
Your query also includes the non-deprecated types like |
|
The deprecation warning may have appeared in a minor version, but the removal of the original values won't happen until the next major version. |
I'm having second thoughts about this API change. While enums are useful for this, and would be great for new things, I think this might be a bit too disruptive given the gains. It would be good to avoid a situation like the What are other's thoughts? (As an aside, I wouldn't be averse to re-adding |
I don't have strong feeling on what the implementation is, only a preference that we aim to be consistent - if a decision is made, that we follow through. For a different example, I'm reluctant about #5309 because we previously told users to use |
I think that would be fine: the message is end users should not use
I think we can change our minds, but should do so with clear communication. We need to balance cost/benefits of BC breaks, and it would be better to do so before release (both as Here's a PR to revert in case we want to go ahead: #6684 |
I closed PR #6684, I somehow had glossed over that the enums were already released in 9.1.0, so this itself would be a breaking change. Some other ideas we're considering:
|
I've created PR #6830 as a suggestion for this. |
With Pillow 9.2.0, I get the following deprecation notice:
Is it really necessary to introduce this breaking API change? Can the old names not be kept for backwards compatibility? Thousands of repositories will need to update their code, wasting countless man-hours.
You can get a rough idea on how many repositories are affected from the following two websites, which search a subset of GitHub repositories:
The text was updated successfully, but these errors were encountered: