none-shall-parse 0.4.4__tar.gz → 0.4.6__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: none-shall-parse
3
- Version: 0.4.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>
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "none-shall-parse"
7
- version = "0.4.4"
7
+ version = "0.4.6"
8
8
  description = "Trinity Shared Python utilities."
9
9
  readme = "README.md"
10
10
  authors = [
@@ -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, collections.Iterable) and not isinstance(el, (str, bytes)):
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