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 |
reviewbot | |
The attributes section should be removed. |
maubin | |
Can you add , optional here. |
maubin | |
Can you add , optional here. |
maubin | |
When taking things in, we should ideally use Sequence instead of list (unless we're assigning directly to a list). |
chipx86 | |
We should return a Mapping with a Sequence instead, so it's not mutable. |
chipx86 | |
Same here: Sequence and Mapping. |
chipx86 | |
I think Iterator is correct here, since the function yields items and is therefore an iterator, rather than returning something … |
chipx86 | |
We should maybe begin moving to keyword-only arguments. Note that subclasses would need any deprecation decorators applied to their versions … |
chipx86 | |
I feel like it'd be preferable to keep this up above where the other attributes are, and keep functions below … |
chipx86 | |
Summary must be on its own line. |
chipx86 | |
Summary must be on its own line. |
chipx86 | |
It'd be nice to move to keyword-only arguments here. |
chipx86 | |
It'd be nice to move to keyword-only arguments here. Same caveat as above. |
chipx86 | |
Should be a django.utils.safestring.SafeString. |
chipx86 | |
We should use Sequence or maybe Iterable here. |
chipx86 | |
Can we type this? |
chipx86 | |
Should maybe be Iterable. |
chipx86 | |
Here, too. |
chipx86 | |
Missing docs. |
chipx86 | |
This needs to be Type, given Python 3.8 compatibility. |
chipx86 | |
Should be Iterable. |
chipx86 | |
line too long (80 > 79 characters) Column: 80 Error code: E501 |
reviewbot |
- 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)