-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add angle setter/getter to Rectangle #19646
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
Conversation
I propose to add This is a consistency issue. We don't have attributes do fancy stuff (and thus have litte public attributes anyway). Defining We don't need staling on We may additionally deprecate |
My approval still stands, although you made flake8 unhappy :) |
Please add tests for the new setters and getters! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think a test is strictly necessary for this, but of course @jklymak is right. Leaving open in case you want to add a test. If not, I'd also merge without.
Test added. It's a simple figure comparison to make sure that setting the rotation after patch creation does the same thing as setting it in the constructor, with some additional tests for |
This adds an
angle
property, such that theRectangle
is labelled stale when it is updated. All the other properties useset_
andget_
, but to maintain backwards compatibility I've used a property here sinceRectangle.angle
already existed.