mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +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
|
@ -119,8 +119,8 @@ class Function(SymbolTable):
|
|||
__globals = None
|
||||
|
||||
def __idents_matching(self, test_func):
|
||||
return tuple([ident for ident in self.get_identifiers()
|
||||
if test_func(self._table.symbols[ident])])
|
||||
return tuple(ident for ident in self.get_identifiers()
|
||||
if test_func(self._table.symbols[ident]))
|
||||
|
||||
def get_parameters(self):
|
||||
if self.__params is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue