Skip to content

Deprecate lrtb (left, right, top, bottom) #1650

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

Merged
merged 10 commits into from
Mar 21, 2023

Conversation

Ibrahim2750mi
Copy link
Contributor

@Ibrahim2750mi Ibrahim2750mi commented Mar 19, 2023

Relevant discussion: https://discord.com/channels/458662222697070613/1087007892575617086/1087015976157073428

Mentions for the world lrtb in the whole arcade package after deprecation:

$ grep -nr -I --exclude-dir='.[^.]*' 'lrtb' .
./arcade/draw_commands.py:622:    message="Drawing with lrtb(left, right, top, bottom) is deprecated use lrbt instead i.e draw_lrbt_rectangle_outline.",
./arcade/draw_commands.py:625:def draw_lrtb_rectangle_outline(left: float, right: float, top: float,
./arcade/draw_commands.py:744:    message="Drawing with lrtb(left, right, top, bottom) is deprecated use lrbt instead i.e draw_lrbt_rectangle_filled.",
./arcade/draw_commands.py:747:def draw_lrtb_rectangle_filled(left: float, right: float, top: float,
./arcade/__init__.py:128:from .draw_commands import draw_lrtb_rectangle_filled
./arcade/__init__.py:130:from .draw_commands import draw_lrtb_rectangle_outline
./arcade/__init__.py:305:    'draw_lrtb_rectangle_filled',
./arcade/__init__.py:307:    'draw_lrtb_rectangle_outline',

Made the warning message more clear.
+ Made the warning decorator accept the new_name instead of warning message
+ Add deprecated warning in docstring
@Ibrahim2750mi Ibrahim2750mi requested review from einarf and pushfoo and removed request for einarf and pushfoo March 20, 2023 14:08
Copy link
Member

@pushfoo pushfoo left a comment

Choose a reason for hiding this comment

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

Looks pretty good. I'll spare you formatting minute and request 3 changes which seem to be actually important.

Ibrahim2750mi and others added 2 commits March 20, 2023 21:08
Co-authored-by: Paul <36696816+pushfoo@users.noreply.github.com>
Co-authored-by: Paul <36696816+pushfoo@users.noreply.github.com>
Copy link
Member

@pushfoo pushfoo left a comment

Choose a reason for hiding this comment

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

I apologize for leaving a separate review, but I think the new functions should raise ValueError instead of AttributeError since there's no attribute access involved.

+ Renamed `NameChangeWarning` to `ReplacementWarning`
+ Used ValueError instead of AttributeError
Copy link
Member

@pushfoo pushfoo left a comment

Choose a reason for hiding this comment

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

Thank you for making the requested changes! It looks good! 👍

Please mark the earlier comment threads as resolved & we should be ready to merge.

@einarf einarf merged commit dd92b40 into pythonarcade:development Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants