Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Use (float, float) as parameter type for 2D positions in docstrings#12237
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -179,9 +179,16 @@ def contains(self, mouseevent): | ||
| def set_offset(self, xy): | ||
| """ | ||
| Set the offset. | ||
| Parameters | ||
| ---------- | ||
| xy : (float, float) or callable | ||
| The (x,y) coordinates of the offset in display units. | ||
| A callable must have the signature:: | ||
| def offset(width, height, xdescent, ydescent, renderer) \ | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I don't get line 191 here... Do you mean it should return (float, float)? MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This is the notation for the return type hint. We're already using this in other places such as: I've just not annotated the function parameters in this example to keep it more readable, and their types are quite obvious anyway. | ||
| -> (float, float) | ||
| """ | ||
| self._offset = xy | ||
| self.stale = True | ||
| @@ -602,9 +609,12 @@ def set_transform(self, t): | ||
| def set_offset(self, xy): | ||
| """ | ||
| Set the offset of the container. | ||
| Parameters | ||
| ---------- | ||
| xy : (float, float) | ||
| The (x,y) coordinates of the offset in display units. | ||
| """ | ||
| self._offset = xy | ||
| @@ -773,9 +783,12 @@ def set_transform(self, t): | ||
| def set_offset(self, xy): | ||
| """ | ||
| Set the offset of the container. | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. the extra "the" wasn't really necessary here. MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I think we mostly use the form with the article in the docs. But I don't care too much. | ||
| Parameters | ||
| ---------- | ||
| xy : (float, float) | ||
| The (x,y) coordinates of the offset in display units. | ||
| """ | ||
| self._offset = xy | ||
| @@ -891,9 +904,12 @@ def set_transform(self, t): | ||
| def set_offset(self, xy): | ||
| """ | ||
| Set the offset of the container. | ||
| Parameters | ||
| ---------- | ||
| xy : (float, float) | ||
| The (x,y) coordinates of the offset in display units. | ||
| """ | ||
| self._offset = xy | ||
| @@ -1294,9 +1310,12 @@ def get_zoom(self): | ||
| # def set_offset(self, xy): | ||
| # """ | ||
| # Set the offset of the container. | ||
| # | ||
| # Parameters | ||
| # ---------- | ||
| # xy : (float, float) | ||
| # The (x,y) coordinates of the offset in display units. | ||
| # """ | ||
| # self._offset = xy | ||