Modernized function typing in reviewboard/accounts/models.py
Review Request #14106 — Created Aug. 16, 2024 and submitted
Modernized function typing in
reviewboard/accounts/models.py
No new tests were added, however the entire
reviewboard
test suite
was run and all previously passing tests still pass.
Summary | ID | Author |
---|---|---|
3e36873cc624c53798cfa815d192edeb9ecea6f2 | Daniel |
Description | From | Last Updated |
---|---|---|
Below, you changed models.Model to be Model, but you didn't change the imports here. |
david | |
Let's add a "Returns:" section to the comment too. |
david | |
This needs a trailing comma. Same for many others in this change. |
david | |
Let's add "Returns:" here too. |
david | |
This should be typed as Group |
david | |
'xhrUnknownErrorText' is defined but never used. Column: 7 Error code: W098 |
reviewbot | |
While we usually treat long imports like this, for typing imports we try to fit as many as them on … |
maubin | |
The closing """ should be on its own line. |
maubin | |
While you're here, can you add a Type: bool after the description in the docstring. |
maubin | |
The closing """ should be on its own line. |
maubin | |
While these types are correct, we actually don't use type annotations for *args and **kwargs, so you can remove the … |
maubin | |
Same comment here for **kwargs, we can remove the type. |
maubin |
- Commits:
-
Summary ID Author 5f47f776d27ef8971a0cfbd5c20142bd356c2724 Daniel 0149e77fc2277cd24c0c5745e3b32f6c6134e5cc Daniel - Diff:
-
Revision 2 (+286 -90)
Checks run (2 succeeded)
- Commits:
-
Summary ID Author 0149e77fc2277cd24c0c5745e3b32f6c6134e5cc Daniel d72bc111c58e20f2fa7a9a78eac84e1d0f19e14a Daniel - Diff:
-
Revision 3 (+3842 -5907)
- Commits:
-
Summary ID Author d72bc111c58e20f2fa7a9a78eac84e1d0f19e14a Daniel 86371cd3e2f0740f6ea2747d28409eaaf059475a Daniel - Diff:
-
Revision 4 (+304 -86)
Checks run (2 succeeded)
-
Thanks for modernizing this.
-
While we usually treat long imports like this, for
typing
imports we try to fit as many as them on one line as possible because its very common for us to import a lot of things from typing. So this should look like this instead:from typing import (Any, ClassVar, Dict, List, Optional, Set, Tuple, TYPE_CHECKING, Union)
-
-
-
-
While these types are correct, we actually don't use type annotations for
*args
and**kwargs
, so you can remove the types here. I'm not really sure why we don't type them. -
- Commits:
-
Summary ID Author 86371cd3e2f0740f6ea2747d28409eaaf059475a Daniel 3e36873cc624c53798cfa815d192edeb9ecea6f2 Daniel - Diff:
-
Revision 5 (+300 -86)