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

Deprecate kivy.utils.interpolate and improve related docs #8459

Merged
merged 4 commits into from Dec 8, 2023

Conversation

Julian-O
Copy link
Contributor

@Julian-O Julian-O commented Nov 15, 2023

  1. interpolate example converges, but never reaches the end value #2788 discusses in detail why interpolate() and should be deprecated. This PR deprecates it.
  2. QueryDict handled missing attributes wrongly. Corrected.
  3. convert_bytes_to_human was arbitrarily left out of __all__. Added in.
  4. Some Python 2 imports remained. Cleaned those out.

Maintainer merge checklist

  • Title is descriptive/clear for inclusion in release notes.
  • Applied a Component: xxx label.
  • Applied the api-deprecation or api-break label.
  • Applied the release-highlight label to be highlighted in release notes.
  • Added to the milestone version it was merged into.
  • Unittests are included in PR.
  • Properly documented, including versionadded, versionchanged as needed.

The interpolate function isn't fit for purpose, and thus likely isn't used in real apps.

Deprecate it now, so it can be removed in the future.

* Code moved down to be after the deprecate decorator is defined.
* Decorated to warn any users.
* Deprecate label for documentation.
* Removed comment that promised things the function couldn't deliver.
* Replaced with an actual description of the (incomprehensible) parameter.

Fixes kivy#2788.
In QueryDict, any attributes that `dict` has takes priority over the key lookup.
Python will only call `__getattr__()` when dict doesn't have the attribute, and `__getattribute__` fails.

Therefore, calling up the chain to ask `dict` again is unnecessary (and triggering a warning on my IDE),
@Julian-O
Copy link
Contributor Author

Failed test ain't due to me. Seems like a network glitch. Run again?

@misl6 misl6 changed the title Clean up utils.py Deprecate kivy.utils.interpolate and improve related docs Dec 8, 2023
@misl6 misl6 added the Component: Misc compat, cache, tools, network, etc. label Dec 8, 2023
@misl6 misl6 added this to the 2.3.0 milestone Dec 8, 2023
@misl6 misl6 added the Notes: API-deprecation API deprecated in the PR label Dec 8, 2023
Copy link
Member

@misl6 misl6 left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you!

@misl6 misl6 merged commit c1d97ce into kivy:master Dec 8, 2023
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Misc compat, cache, tools, network, etc. Notes: API-deprecation API deprecated in the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants