Refactor encode_multipart_formdata and tests to be easier to read and maintain
Review Request #9653 — Created Feb. 16, 2018 and discarded
Refactor encode_multipart_formdata and tests to be easier to read and maintain.
Will update with the remaining fixes.
Description | From | Last Updated |
---|---|---|
This should be part of the same import group. |
chipx86 | |
Blank line between statements/blocks and other blocks. |
chipx86 | |
Docstrings for functions must meet a standard format described at https://www.notion.so/reviewboard/Writing-Codebase-Documentation-e16312b5f061437cb73cbfa369ac3cb5 |
chipx86 | |
BytesIO() was the correct way to go. Concatenating strings in Python is slow and bad for garbage collection. You almost … |
chipx86 | |
Blank line between statements and comments. |
chipx86 | |
Blank line between these. There's more in the file. Can you go through and fix those up? If there's others … |
chipx86 | |
We always want to use explicit encodings in calls to encode() and decode(). |
chipx86 | |
We use % instead of .format(). |
chipx86 | |
This is not Python 2.7-compatible. All code must work on Python 2.7 as well, and we want to see testing … |
chipx86 | |
This is not efficient. This should be reverted. |
chipx86 |
- Description:
-
Refactor encode_multipart_formdata and tests to be easier to read and maintain.
~ This is the biggest functional code change.
~ This is the biggest functional code change.
+ https://reviews.reviewboard.org/r/9648/ + https://reviews.reviewboard.org/r/9649/ + https://reviews.reviewboard.org/r/9650/ + https://reviews.reviewboard.org/r/9651/ + https://reviews.reviewboard.org/r/9652/ + https://reviews.reviewboard.org/r/9653/ + https://reviews.reviewboard.org/r/9654/ + https://reviews.reviewboard.org/r/9655/ - Depends On:
-
-
-
-
-
Docstrings for functions must meet a standard format described at https://www.notion.so/reviewboard/Writing-Codebase-Documentation-e16312b5f061437cb73cbfa369ac3cb5
-
BytesIO()
was the correct way to go. Concatenating strings in Python is slow and bad for garbage collection. You almost never want to concatenate strings if you're going to do more than a few. Instead, you always want to use something likeBytesIO()
,StringIO()
, or add them to a list and join them back into a string. -
-
Blank line between these.
There's more in the file. Can you go through and fix those up? If there's others like this in other files, those will also need to be fixed.
-
-
-
This is not Python 2.7-compatible.
All code must work on Python 2.7 as well, and we want to see testing that assures this.
-
- Description:
-
Refactor encode_multipart_formdata and tests to be easier to read and maintain.
- - This is the biggest functional code change.
- https://reviews.reviewboard.org/r/9648/ - https://reviews.reviewboard.org/r/9649/ - https://reviews.reviewboard.org/r/9650/ - https://reviews.reviewboard.org/r/9651/ - https://reviews.reviewboard.org/r/9652/ - https://reviews.reviewboard.org/r/9653/ - https://reviews.reviewboard.org/r/9654/ - https://reviews.reviewboard.org/r/9655/ - Testing Done:
-
~ Not sure what to put here since these intermediate commits don't pass tests or flake8.
~ Will update with the remaining fixes.
- Depends On:
-
- Commit:
466454634336d7498af27955e6bd40eb584c90a31b420efd0cc224ddddf2ebf9884c18e5ce84b8b4- Diff:
Revision 2 (+89 -94)
Checks run (2 succeeded)
flake8 passed.JSHint passed.