mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
bpo-30296 Remove unnecessary tuples, lists, sets, and dicts (#1489)
* Replaced list(<generator expression>) with list comprehension * Replaced dict(<generator expression>) with dict comprehension * Replaced set(<list literal>) with set literal * Replaced builtin func(<list comprehension>) with func(<generator expression>) when supported (e.g. any(), all(), tuple(), min(), & max())
This commit is contained in:
parent
906f5330b9
commit
3972628de3
19 changed files with 32 additions and 39 deletions
|
|
@ -500,8 +500,7 @@ def add_callers(target, source):
|
|||
if func in new_callers:
|
||||
if isinstance(caller, tuple):
|
||||
# format used by cProfile
|
||||
new_callers[func] = tuple([i[0] + i[1] for i in
|
||||
zip(caller, new_callers[func])])
|
||||
new_callers[func] = tuple(i[0] + i[1] for i in zip(caller, new_callers[func]))
|
||||
else:
|
||||
# format used by profile
|
||||
new_callers[func] += caller
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue