dotted-notation 0.44.4__tar.gz → 0.44.5__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 (38) hide show
  1. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/CHANGELOG.md +8 -0
  2. {dotted_notation-0.44.4/dotted_notation.egg-info → dotted_notation-0.44.5}/PKG-INFO +1 -1
  3. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/api.py +7 -1
  4. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/results.py +6 -5
  5. {dotted_notation-0.44.4 → dotted_notation-0.44.5/dotted_notation.egg-info}/PKG-INFO +1 -1
  6. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/pyproject.toml +1 -1
  7. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/LICENSE +0 -0
  8. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/MANIFEST.in +0 -0
  9. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/README.md +0 -0
  10. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/__init__.py +0 -0
  11. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/__main__.py +0 -0
  12. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/access.py +0 -0
  13. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/base.py +0 -0
  14. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/cli/__init__.py +0 -0
  15. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/cli/_compat.py +0 -0
  16. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/cli/formats.py +0 -0
  17. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/cli/main.py +0 -0
  18. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/containers.py +0 -0
  19. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/engine.py +0 -0
  20. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/filters.py +0 -0
  21. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/grammar.py +0 -0
  22. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/groups.py +0 -0
  23. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/matchers.py +0 -0
  24. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/predicates.py +0 -0
  25. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/recursive.py +0 -0
  26. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/sql/__init__.py +0 -0
  27. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/sql/core.py +0 -0
  28. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/sql/pg.py +0 -0
  29. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/transforms.py +0 -0
  30. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/utils.py +0 -0
  31. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/utypes.py +0 -0
  32. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted/wrappers.py +0 -0
  33. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted_notation.egg-info/SOURCES.txt +0 -0
  34. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted_notation.egg-info/dependency_links.txt +0 -0
  35. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted_notation.egg-info/entry_points.txt +0 -0
  36. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted_notation.egg-info/requires.txt +0 -0
  37. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/dotted_notation.egg-info/top_level.txt +0 -0
  38. {dotted_notation-0.44.4 → dotted_notation-0.44.5}/setup.cfg +0 -0
@@ -3,6 +3,14 @@
3
3
  All notable changes to `dotted` are recorded here. Versions prior to
4
4
  the ones listed are omitted — browse git history for earlier entries.
5
5
 
6
+ ## [0.44.5]
7
+
8
+ ### Performance
9
+ - Transforms no longer disqualify the get() fast path: `a.b|int`
10
+ resolves via the direct-lookup chain and applies transforms on the
11
+ hit (~7x faster than walk). Plain paths are unaffected; `is_simple()`
12
+ semantics unchanged (still requires no transforms).
13
+
6
14
  ## [0.44.4]
7
15
 
8
16
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dotted_notation
3
- Version: 0.44.4
3
+ Version: 0.44.5
4
4
  Summary: Dotted notation for safe nested data traversal with optional chaining, pattern matching, and transforms
5
5
  Author-email: Frey Waid <logophage1@gmail.com>
6
6
  License: MIT
@@ -287,6 +287,8 @@ def is_simple(path):
287
287
  False
288
288
  """
289
289
  parsed = path if isinstance(path, results.Dotted) else parse(path)
290
+ if parsed.transforms:
291
+ return False
290
292
  return parsed.simple_chain is not None
291
293
 
292
294
 
@@ -451,7 +453,11 @@ def get(obj, path, default=None, pattern_default=(), apply_transforms=True, stri
451
453
  if chain is not None:
452
454
  val = engine.simple_get(chain, obj, strict=strict)
453
455
  if val is not engine.SIMPLE_BAIL:
454
- return default if val is base.marker else val
456
+ if val is base.marker:
457
+ return default
458
+ if apply_transforms and ops.transforms:
459
+ return ops.apply(val)
460
+ return val
455
461
  vals = engine.iter_until_cut(engine.gets(ops, obj, strict=strict))
456
462
  if apply_transforms:
457
463
  vals = ( ops.apply(v) for v in vals )
@@ -113,13 +113,14 @@ class Dotted:
113
113
  @lazyprop
114
114
  def simple_chain(self):
115
115
  """
116
- Tuple of (kind, key) pairs when this path is simple — a plain chain
117
- of concrete Key/Attr/Slot accesses with no patterns, substitutions,
118
- references, guards, transforms, or filters — else None. Computed
119
- once and cached; drives the fast path in get() that skips walk().
116
+ Tuple of (kind, key) pairs when the access chain is simple — a plain
117
+ chain of concrete Key/Attr/Slot accesses with no patterns,
118
+ substitutions, references, guards, or filters — else None. Transforms
119
+ are permitted (they apply after the lookup). Computed once and
120
+ cached; drives the fast path in get() that skips walk().
120
121
  kind is 'key', 'attr', or 'slot'.
121
122
  """
122
- if self.transforms or self.guard is not None:
123
+ if self.guard is not None:
123
124
  return None
124
125
  chain = []
125
126
  for op in self.ops:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dotted_notation
3
- Version: 0.44.4
3
+ Version: 0.44.5
4
4
  Summary: Dotted notation for safe nested data traversal with optional chaining, pattern matching, and transforms
5
5
  Author-email: Frey Waid <logophage1@gmail.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dotted_notation"
7
- version = "0.44.4"
7
+ version = "0.44.5"
8
8
  description = "Dotted notation for safe nested data traversal with optional chaining, pattern matching, and transforms"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.6"