hunterMakesPy 0.7.4__tar.gz → 0.7.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.
Files changed (27) hide show
  1. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/PKG-INFO +1 -1
  2. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy/__init__.py +3 -1
  3. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy/parseParameters.py +16 -23
  4. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy/semiotics.py +2 -0
  5. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy.egg-info/PKG-INFO +1 -1
  6. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/pyproject.toml +1 -1
  7. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/LICENSE +0 -0
  8. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/README.md +0 -0
  9. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy/_theSSOT.py +0 -0
  10. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy/coping.py +0 -0
  11. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy/dataStructures.py +0 -0
  12. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy/filesystemToolkit.py +0 -0
  13. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy/py.typed +0 -0
  14. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy/tests/__init__.py +0 -0
  15. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy/tests/conftest.py +0 -0
  16. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy/tests/test_coping.py +0 -0
  17. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy/tests/test_dataStructures.py +0 -0
  18. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy/tests/test_filesystemToolkit.py +0 -0
  19. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy/tests/test_parseParameters.py +0 -0
  20. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy/tests/test_theTypes.py +0 -0
  21. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy/theTypes.py +0 -0
  22. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy/theTypesCallableFunction.py +0 -0
  23. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy.egg-info/SOURCES.txt +0 -0
  24. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy.egg-info/dependency_links.txt +0 -0
  25. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy.egg-info/requires.txt +0 -0
  26. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/hunterMakesPy.egg-info/top_level.txt +0 -0
  27. {huntermakespy-0.7.4 → huntermakespy-0.7.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hunterMakesPy
3
- Version: 0.7.4
3
+ Version: 0.7.6
4
4
  Summary: Easy Python functions making making functional Python functions easier.
5
5
  Author-email: Hunter Hogan <HunterHogan@pm.me>
6
6
  License-Expression: CC-BY-NC-4.0
@@ -68,7 +68,9 @@ References
68
68
  # isort: split
69
69
  from __future__ import annotations
70
70
 
71
- from hunterMakesPy.semiotics import decreasing as decreasing, errorL33T as errorL33T, inclusive as inclusive, zeroIndexed as zeroIndexed
71
+ from hunterMakesPy.semiotics import (
72
+ ansiColor as ansiColor, ansiColorReset as ansiColorReset, decreasing as decreasing, errorL33T as errorL33T, inclusive as inclusive,
73
+ oneIndexed as oneIndexed, zeroIndexed as zeroIndexed)
72
74
 
73
75
  # isort: split
74
76
  from hunterMakesPy.theTypes import (
@@ -1,4 +1,4 @@
1
- # ruff: noqa: TRY301, DOC501, PLW0717 BLE001
1
+ # ruff: file-ignore[raise-within-try, docstring-missing-exception, too-many-statements-in-try-clause, blind-except]
2
2
  """Validate parameters and parse input with defensive error handling.
3
3
 
4
4
  (AI generated docstring)
@@ -45,7 +45,7 @@ import sys
45
45
 
46
46
  if TYPE_CHECKING:
47
47
  from charset_normalizer.models import CharsetMatch
48
- from collections.abc import Iterable
48
+ from collections.abc import Collection
49
49
  from hunterMakesPy.theTypes import Limitation
50
50
  from typing import Any
51
51
 
@@ -195,7 +195,7 @@ def _constructErrorMessage(context: ErrorMessageContext, parameterName: str, par
195
195
 
196
196
  return "".join(messageParts)
197
197
 
198
- def intInnit(listInt_Allegedly: Iterable[Any], parameterName: str | None = None, parameterType: type[Any] | None = None) -> list[int]:
198
+ def intInnit(listInt_Allegedly: Collection[Any], parameterName: str | None = None, parameterType: type[Any] | None = None) -> list[int]:
199
199
  """Validate and convert input values to a `list` of integers.
200
200
 
201
201
  Accepts various numeric types and attempts to convert them into integers while providing descriptive error messages. This
@@ -204,7 +204,7 @@ def intInnit(listInt_Allegedly: Iterable[Any], parameterName: str | None = None,
204
204
 
205
205
  Parameters
206
206
  ----------
207
- listInt_Allegedly : Iterable[Any]
207
+ listInt_Allegedly : Collection[Any]
208
208
  The input sequence that should contain integer-compatible values. Accepts integers, strings, floats, complex numbers, and
209
209
  binary data. Rejects boolean values and non-integer numeric values.
210
210
  parameterName : str | None = None
@@ -236,7 +236,7 @@ def intInnit(listInt_Allegedly: Iterable[Any], parameterName: str | None = None,
236
236
  parameterType = parameterType or list
237
237
 
238
238
  if not listInt_Allegedly:
239
- message: str = f"I did not receive a value for {parameterName}, but it is required."
239
+ message: str = f"I did not receive a value for `{parameterName}`, but I must have it."
240
240
  raise ValueError(message)
241
241
 
242
242
  # Be nice, and assume the input container is valid and every element is valid.
@@ -250,11 +250,10 @@ def intInnit(listInt_Allegedly: Iterable[Any], parameterName: str | None = None,
250
250
  listValidated: list[int] = []
251
251
 
252
252
  for allegedInt in listInt_Allegedly:
253
-
254
253
  errorMessageContext: ErrorMessageContext = ErrorMessageContext(
255
- parameterValue=allegedInt,
256
- parameterValueType=type(allegedInt).__name__,
257
- isElement=True
254
+ parameterValue=allegedInt
255
+ , parameterValueType=type(allegedInt).__name__
256
+ , isElement=True
258
257
  )
259
258
 
260
259
  # Always rejected as ambiguous
@@ -292,26 +291,20 @@ def intInnit(listInt_Allegedly: Iterable[Any], parameterName: str | None = None,
292
291
  if lengthInitial is not None and isinstance(listInt_Allegedly, Sized) and len(listInt_Allegedly) != lengthInitial:
293
292
  raise RuntimeError((lengthInitial, len(listInt_Allegedly)))
294
293
 
295
- except (TypeError, ValueError) as ERRORmessage:
296
- if isinstance(ERRORmessage.args[0], ErrorMessageContext):
297
- context: ErrorMessageContext = ERRORmessage.args[0]
294
+ except (TypeError, ValueError) as ERROR:
295
+ if isinstance(ERROR.args[0], ErrorMessageContext):
296
+ context: ErrorMessageContext = ERROR.args[0]
298
297
  if not context.containerType:
299
298
  context.containerType = type(listInt_Allegedly).__name__
300
299
  message = _constructErrorMessage(context, parameterName, parameterType)
301
- raise type(ERRORmessage)(message) from None
300
+ raise type(ERROR)(message) from None
302
301
  # If it's not our Exception, don't molest it
303
302
  raise
304
303
 
305
- except RuntimeError as ERRORruntime:
306
- lengthCurrent: int
307
- lengthInitial, lengthCurrent = ERRORruntime.args[0]
308
- ERRORmessage = (
309
- f"The input sequence {parameterName} was modified during iteration. "
310
- f"Initial length {lengthInitial}, current length {lengthCurrent}."
311
- )
312
- raise RuntimeError(
313
- ERRORmessage
314
- ) from None
304
+ except RuntimeError as ERROR:
305
+ lengthInitial, lengthCurrent = ERROR.args[0]
306
+ message = (f"`{parameterName}` was modified during iteration: {lengthInitial = }, current length {lengthCurrent = }.")
307
+ raise RuntimeError(message) from None
315
308
 
316
309
  else:
317
310
  return listValidated
@@ -503,3 +503,5 @@ class AnsiColors(NamedTuple):
503
503
  YellowOnBlack: str = '\x1b[33;40m'
504
504
  YellowOnBlue: str = '\x1b[33;44m'
505
505
  YellowOnRed: str = '\x1b[33;41m'
506
+
507
+ ansiColor = AnsiColors()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hunterMakesPy
3
- Version: 0.7.4
3
+ Version: 0.7.6
4
4
  Summary: Easy Python functions making making functional Python functions easier.
5
5
  Author-email: Hunter Hogan <HunterHogan@pm.me>
6
6
  License-Expression: CC-BY-NC-4.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "hunterMakesPy"
3
- version = "0.7.4"
3
+ version = "0.7.6"
4
4
  description = "Easy Python functions making making functional Python functions easier."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
File without changes
File without changes
File without changes