From ec8efebc94311a9e27b388afff3a379b757d35d0 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 2 Jun 2022 08:31:28 -0700 Subject: [PATCH] move _get_item outside of parse function --- jc/parsers/id.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/jc/parsers/id.py b/jc/parsers/id.py index 098daa18..1176dc6d 100644 --- a/jc/parsers/id.py +++ b/jc/parsers/id.py @@ -144,6 +144,13 @@ def _process(proc_data): return proc_data +def _get_item(list, index, default=None): + if index < len(list): + return list[index] + + return default + + def parse(data, raw=False, quiet=False): """ Main text parsing function @@ -158,12 +165,6 @@ def parse(data, raw=False, quiet=False): Dictionary. Raw or processed structured data. """ - def _get_item(list, index, default=None): - if index < len(list): - return list[index] - - return default - jc.utils.compatibility(__name__, info.compatible, quiet) jc.utils.input_type_check(data)