none-shall-parse 0.4.4__py3-none-any.whl → 0.4.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
none_shall_parse/lists.py
CHANGED
|
@@ -20,13 +20,13 @@ def flatten(some_list: Iterable) -> Generator[Any, None, None]:
|
|
|
20
20
|
:rtype: Generator[Any, None, None]
|
|
21
21
|
"""
|
|
22
22
|
for el in some_list:
|
|
23
|
-
if isinstance(el,
|
|
23
|
+
if isinstance(el, Iterable) and not isinstance(el, (str, bytes)):
|
|
24
24
|
yield from flatten(el)
|
|
25
25
|
else:
|
|
26
26
|
yield el
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
def safe_list_get(lst: List[T], idx: int, default: T) -> T:
|
|
29
|
+
def safe_list_get(lst: List[T], idx: int, default: T = None) -> T:
|
|
30
30
|
"""
|
|
31
31
|
Retrieve an element from a list by its index or return a default value if the index
|
|
32
32
|
is out of range. This function ensures no IndexError is raised during the retrieval
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: none-shall-parse
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.6
|
|
4
4
|
Summary: Trinity Shared Python utilities.
|
|
5
5
|
Author: Andries Niemandt, Jan Badenhorst
|
|
6
6
|
Author-email: Andries Niemandt <andries.niemandt@trintel.co.za>, Jan Badenhorst <jan@trintel.co.za>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
none_shall_parse/__init__.py,sha256=CTi08pRGuTem3KhOAKP_hO1oBfMzEHZymDhn4jIH0tU,3833
|
|
2
2
|
none_shall_parse/dates.py,sha256=DRgVVAFUOHj42nIiXuMYrwOtCEsf6qz1eU0y8eP6q9o,26661
|
|
3
3
|
none_shall_parse/imeis.py,sha256=20pONoUhLKomZxAJegqSSjG72hZjYs60r8IcaRt-15M,6770
|
|
4
|
-
none_shall_parse/lists.py,sha256=
|
|
4
|
+
none_shall_parse/lists.py,sha256=PKtYD8H1Z7MqbJQ5eFpsK_jgexLwiratMJiYeRMiOwc,1701
|
|
5
5
|
none_shall_parse/parse.py,sha256=77bXZAtwFksRwuZ9Ax0lPxEjFpyjkQBqRa5mBc1WkF4,6843
|
|
6
6
|
none_shall_parse/strings.py,sha256=F7491CJAHJjL7vdEGwoH_4S6PjaovYUS_yzVGJ-bYIE,8463
|
|
7
7
|
none_shall_parse/types.py,sha256=WAgILMtW2_fm9MBpUuQvq68yXYBNd3rnSoQk70ibOd4,1320
|
|
8
|
-
none_shall_parse-0.4.
|
|
9
|
-
none_shall_parse-0.4.
|
|
10
|
-
none_shall_parse-0.4.
|
|
8
|
+
none_shall_parse-0.4.6.dist-info/WHEEL,sha256=4n27za1eEkOnA7dNjN6C5-O2rUiw6iapszm14Uj-Qmk,79
|
|
9
|
+
none_shall_parse-0.4.6.dist-info/METADATA,sha256=6nU1Dw7l_fkpjchAq8TUQqC6y236y6G093J9Zy_gjL8,1701
|
|
10
|
+
none_shall_parse-0.4.6.dist-info/RECORD,,
|
|
File without changes
|