log21 3.3.3__tar.gz → 3.5.0__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: log21
3
- Version: 3.3.3
3
+ Version: 3.5.0
4
4
  Summary: A simple logging package
5
5
  Keywords: python,log,colorize,color,logging,Python3,CodeWriter21
6
6
  Author: CodeWriter21(Mehrad Pooryoussof)
@@ -29,7 +29,6 @@ log21
29
29
 
30
30
  ![version](https://img.shields.io/pypi/v/log21)
31
31
  [![pipeline status](https://gitlab.com/CodeWriter21/log21/badges/master/pipeline.svg)](https://gitlab.com/CodeWriter21/log21/-/commits/master)
32
- [![repo size](https://img.shields.io/gitlab/repo-size/CodeWriter21/log21)](https://gitlab.com/CodeWriter21/log21)
33
32
 
34
33
  A simple logging package that helps you log colorized messages in Windows console and
35
34
  other operating systems.
@@ -3,7 +3,6 @@ log21
3
3
 
4
4
  ![version](https://img.shields.io/pypi/v/log21)
5
5
  [![pipeline status](https://gitlab.com/CodeWriter21/log21/badges/master/pipeline.svg)](https://gitlab.com/CodeWriter21/log21/-/commits/master)
6
- [![repo size](https://img.shields.io/gitlab/repo-size/CodeWriter21/log21)](https://gitlab.com/CodeWriter21/log21)
7
6
 
8
7
  A simple logging package that helps you log colorized messages in Windows console and
9
8
  other operating systems.
@@ -23,7 +23,7 @@ dependencies = [
23
23
  "webcolors",
24
24
  "docstring-parser"
25
25
  ]
26
- version = "3.3.3"
26
+ version = "3.5.0"
27
27
 
28
28
  [build-system]
29
29
  requires = ["uv_build>=0.8.15,<0.9.0"]
@@ -33,7 +33,7 @@ from .stream_handler import StreamHandler, ColorizingStreamHandler
33
33
  # yapf: enable
34
34
 
35
35
  __author__ = 'CodeWriter21 (Mehrad Pooryoussof)'
36
- __version__ = '3.3.3'
36
+ __version__ = '3.5.0'
37
37
  __github__ = 'https://GitHub.com/MPCodeWriter21/log21'
38
38
  __all__ = [
39
39
  'ColorizingStreamHandler', 'DecolorizingFileHandler', 'ColorizingFormatter',
@@ -612,13 +612,17 @@ class _ActionsContainer(_argparse._ActionsContainer): # novm
612
612
  else:
613
613
  func_type = func_type.__args__ # type: ignore
614
614
 
615
- # Handle `List` as a type (e.g. `List[int]`)
615
+ # Handle `List` as a type (e.g. `List[int]` and builtin `list[int]`)
616
616
  elif (hasattr(_typing, '_GenericAlias')
617
617
  and isinstance(func_type, _typing._GenericAlias) # type: ignore
618
618
  and func_type.__origin__ is list) or (
619
619
  hasattr(_typing, '_GenericAlias')
620
620
  and isinstance(func_type, _typing._GenericAlias) # type: ignore
621
- and func_type.__origin__ is collections.abc.Sequence):
621
+ and func_type.__origin__ is collections.abc.Sequence) or (
622
+ hasattr(_types, 'GenericAlias')
623
+ and isinstance(func_type, _types.GenericAlias)
624
+ and getattr(func_type, '__origin__', None) in
625
+ (list, collections.abc.Sequence)):
622
626
  func_type = func_type.__args__[0]
623
627
  if kwargs.get('nargs') is None:
624
628
  action.nargs = '+'
@@ -668,6 +672,15 @@ class _ActionsContainer(_argparse._ActionsContainer): # novm
668
672
  _types.UnionType,
669
673
  ))):
670
674
  func_type = self._validate_func_type(action, func_type, kwargs, level + 1)
675
+ elif (hasattr(_types, 'GenericAlias')
676
+ and isinstance(func_type, _types.GenericAlias)
677
+ and getattr(func_type, '__origin__', None) in
678
+ (list, collections.abc.Sequence)):
679
+ # Builtin `list[T]` unwrapped from a PEP 604 optional (e.g.
680
+ # `list[str] | None`): route it through the `List` branch above.
681
+ # Restricted to list/Sequence origins so other generics (e.g.
682
+ # `dict[str, int]`) cannot recurse forever.
683
+ func_type = self._validate_func_type(action, func_type, kwargs, level + 1)
671
684
  else:
672
685
  func_type = (func_type, )
673
686