Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use chain.from_iterable in class_validators.py (#1642)
* Use chain.from_iterable in class_validators.py * fix change Co-authored-by: Samuel Colvin <s@muelcolvin.com>
- Loading branch information
1 parent
5a2d787
commit ecb54c5
Showing
2 changed files
with
6 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Use `chain.from_iterable` in class_validators.py. This is a faster and more idiomatic way of using `itertools.chain`. | ||
Instead of computing all the items in the iterable and storing them in memory, they are computed one-by-one and never | ||
stored as a huge list. This can save on both runtime and memory space. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters