mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-04 15:56:08 +08:00
Python: Replace more lists with generators (#23116)
* Replace lists with generators v2
* Replace set with {}
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
* Replace more set() with {}
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 6951b3271d
This commit is contained in:
@@ -4,7 +4,7 @@ import ast
|
||||
import stat
|
||||
import subprocess
|
||||
|
||||
fouts = set([x.decode('utf-8') for x in subprocess.check_output(['git', 'ls-files']).strip().split()])
|
||||
fouts = {x.decode('utf-8') for x in subprocess.check_output(['git', 'ls-files']).strip().split()}
|
||||
|
||||
pyf = []
|
||||
for d in ["cereal", "common", "scripts", "selfdrive", "tools"]:
|
||||
|
||||
@@ -10,6 +10,6 @@ with open(os.path.join(BASEDIR, "docs/CARS.md")) as f:
|
||||
cars = [l for l in lines if l.strip().startswith("|") and l.strip().endswith("|") and
|
||||
"Make" not in l and any(c.isalpha() for c in l)]
|
||||
|
||||
make_count = Counter([l.split('|')[1].split('|')[0].strip() for l in cars])
|
||||
make_count = Counter(l.split('|')[1].split('|')[0].strip() for l in cars)
|
||||
print("\n", "*"*20, len(cars), "total", "*"*20, "\n")
|
||||
pprint(make_count)
|
||||
|
||||
Reference in New Issue
Block a user