Add typing to reviews/detail.py
Review Request #14019 — Created July 9, 2024 and submitted
This change adds type hints throughout our ReviewRequestPageData and
entry implementations.
Ran unit tests.
Summary | ID |
---|---|
f8b33c4d5e73098ec88af02b242d6f4b4297f155 |
Description | From | Last Updated |
---|---|---|
too many blank lines (3) Column: 1 Error code: E303 |
![]() |
|
The attributes section should be removed. |
![]() |
|
Can you add , optional here. |
![]() |
|
Can you add , optional here. |
![]() |
|
When taking things in, we should ideally use Sequence instead of list (unless we're assigning directly to a list). |
|
|
We should return a Mapping with a Sequence instead, so it's not mutable. |
|
|
Same here: Sequence and Mapping. |
|
|
I think Iterator is correct here, since the function yields items and is therefore an iterator, rather than returning something … |
|
|
We should maybe begin moving to keyword-only arguments. Note that subclasses would need any deprecation decorators applied to their versions … |
|
|
I feel like it'd be preferable to keep this up above where the other attributes are, and keep functions below … |
|
|
Summary must be on its own line. |
|
|
Summary must be on its own line. |
|
|
It'd be nice to move to keyword-only arguments here. |
|
|
It'd be nice to move to keyword-only arguments here. Same caveat as above. |
|
|
Should be a django.utils.safestring.SafeString. |
|
|
We should use Sequence or maybe Iterable here. |
|
|
Can we type this? |
|
|
Should maybe be Iterable. |
|
|
Here, too. |
|
|
Missing docs. |
|
|
This needs to be Type, given Python 3.8 compatibility. |
|
|
Should be Iterable. |
|
|
line too long (80 > 79 characters) Column: 80 Error code: E501 |
![]() |
- Commits:
-
Summary ID 93061085709e43fa2a147fdd90b43b2aef597e5f a5785e9f5c54c47f0574bd7e89233d359536a34e - Diff:
-
Revision 2 (+658 -400)
Checks run (2 succeeded)
- Commits:
-
Summary ID a5785e9f5c54c47f0574bd7e89233d359536a34e 46d0af1834f6d1b8baa631856f0edd845f71ae6e - Diff:
-
Revision 3 (+660 -424)
Checks run (2 succeeded)
-
-
When taking things in, we should ideally use
Sequence
instead oflist
(unless we're assigning directly to alist
). -
-
-
I think
Iterator
is correct here, since the function yields items and is therefore an iterator, rather than returning something that can be iterated over.Usually
Iterator
is taken in as something you want to iterate over, andIterator
(a subtype ofIterator
) is returned as a thing from a function providing iteration. -
We should maybe begin moving to keyword-only arguments.
Note that subclasses would need any deprecation decorators applied to their versions as well. Same with any other cases like this.
-
I feel like it'd be preferable to keep this up above where the other attributes are, and keep functions below any attributes, even if they're classmethods. These get heavily buried otherwise.
-
-
-
-
-
-
-
-
-
-
-
-
- Commits:
-
Summary ID 46d0af1834f6d1b8baa631856f0edd845f71ae6e 5e627ae8571b43d2d0ccd4fae4b16e6917d5e49c - Diff:
-
Revision 4 (+670 -426)
- Commits:
-
Summary ID 5e627ae8571b43d2d0ccd4fae4b16e6917d5e49c f8b33c4d5e73098ec88af02b242d6f4b4297f155 - Diff:
-
Revision 5 (+674 -426)