Skip to content

Commit

Permalink
linting - use list literal
Browse files Browse the repository at this point in the history
  • Loading branch information
davmlaw committed Sep 20, 2023
1 parent 539ea7d commit f7cf29b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions library/utils/xml_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ def get_parser_methods(cls, prefix: List):
# determine if we only save tagName
def __init__(self, prefix: Optional[List] = None):
self._prefix = prefix or []
self._stack: List = list()
self._candidates: List[List[Callable]] = list()
self._execute: List[List[Callable]] = list()
self._stack: List = []
self._candidates: List[List[Callable]] = []
self._execute: List[List[Callable]] = []
self._yieldable: Optional = None

def set_yieldable(self, obj):
Expand All @@ -140,9 +140,9 @@ def finish(self):
pass

def parse(self, source):
self._stack = list()
self._stack = []
self._candidates = [self.__class__.get_parser_methods(self._prefix)]
self._execute = list()
self._execute = []

context = etree.iterparse(source, events=('start', 'end'), huge_tree=True, recover=True, encoding="utf-8")
for event, elem in context:
Expand All @@ -163,8 +163,8 @@ def _peek_candidates(self):

def _push(self, elem):
self._stack.append(elem)
execute_later = list()
remaining_candidates = list()
execute_later = []
remaining_candidates = []
evaluated = [cand for cand in [cand.test_and_remainder(elem) for cand in self._peek_candidates]
if cand]
for candidate in evaluated:
Expand Down

0 comments on commit f7cf29b

Please sign in to comment.