htmy 0.4.1__tar.gz → 0.4.2__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
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: htmy
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: Async, pure-Python rendering engine.
5
5
  License: MIT
6
6
  Author: Peter Volf
@@ -27,8 +27,9 @@ from .typing import (
27
27
  from .utils import join_components
28
28
 
29
29
  if TYPE_CHECKING:
30
- from typing_extensions import Self
30
+ from typing_extensions import Never, Self
31
31
  else:
32
+ Never = Any
32
33
  Self = Any
33
34
 
34
35
  # -- Utility components
@@ -348,6 +349,11 @@ class SkipProperty(Exception):
348
349
 
349
350
  ...
350
351
 
352
+ @classmethod
353
+ def format_property(cls, _: Any) -> Never:
354
+ """Property formatter that raises a `SkipProperty` error regardless of the received value."""
355
+ raise cls("skip-property")
356
+
351
357
 
352
358
  class Text(str):
353
359
  """Marker class for differentiating text content from other strings."""
@@ -484,6 +490,7 @@ class Formatter(ContextAware):
484
490
  date: lambda d: cast(date, d).isoformat(),
485
491
  datetime: lambda d: cast(datetime, d).isoformat(),
486
492
  XBool: lambda v: cast(XBool, v).format(),
493
+ type(None): SkipProperty.format_property,
487
494
  }
488
495
 
489
496
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "htmy"
3
- version = "0.4.1"
3
+ version = "0.4.2"
4
4
  description = "Async, pure-Python rendering engine."
5
5
  authors = ["Peter Volf <do.volfp@gmail.com>"]
6
6
  license = "MIT"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes