datahold 4.0.0.dev29__tar.gz → 4.0.0.dev30__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 (40) hide show
  1. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/PKG-INFO +1 -1
  2. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/pyproject.toml +1 -1
  3. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/src/datahold/__init__.py +25 -30
  4. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/src/datahold.egg-info/PKG-INFO +1 -1
  5. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/LICENSE.txt +0 -0
  6. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/MANIFEST.in +0 -0
  7. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/README.rst +0 -0
  8. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/docs/v1.1.rst +0 -0
  9. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/docs/v1.2.rst +0 -0
  10. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/docs/v2.0.rst +0 -0
  11. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/docs/v2.1.rst +0 -0
  12. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/docs/v2.2.rst +0 -0
  13. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/docs/v2.3.rst +0 -0
  14. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/docs/v3.0.rst +0 -0
  15. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/docs/v4.0.rst +0 -0
  16. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/run_tests.py +0 -0
  17. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/setup.cfg +0 -0
  18. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/src/datahold/py.typed +0 -0
  19. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/src/datahold.egg-info/SOURCES.txt +0 -0
  20. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/src/datahold.egg-info/dependency_links.txt +0 -0
  21. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/src/datahold.egg-info/requires.txt +0 -0
  22. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/src/datahold.egg-info/top_level.txt +0 -0
  23. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_FrozenDictSlot.py +0 -0
  24. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_FrozenListSlot.py +0 -0
  25. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_FrozenSetSlot.py +0 -0
  26. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_MutableDictSlot.py +0 -0
  27. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_MutableListSlot.py +0 -0
  28. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_MutableSetSlot.py +0 -0
  29. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_abstractmethods.py +0 -0
  30. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_all.py +0 -0
  31. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_attributes.py +0 -0
  32. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_docs.py +0 -0
  33. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_generic.py +0 -0
  34. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_issubclass.py +0 -0
  35. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_metaclass.py +0 -0
  36. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_name.py +0 -0
  37. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_nested.py +0 -0
  38. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_sorted.py +0 -0
  39. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_variance.py +0 -0
  40. {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/testdata.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datahold
3
- Version: 4.0.0.dev29
3
+ Version: 4.0.0.dev30
4
4
  Summary: This project wraps common mutable datastructures for inheritance with modification.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License-Expression: MIT
@@ -31,7 +31,7 @@ license-files = [
31
31
  name = "datahold"
32
32
  readme = "README.rst"
33
33
  requires-python = ">=3.11"
34
- version = "4.0.0.dev29"
34
+ version = "4.0.0.dev30"
35
35
 
36
36
  [project.urls]
37
37
  Download = "https://pypi.org/project/datahold/#files"
@@ -37,15 +37,7 @@ from abc import ABCMeta, abstractmethod
37
37
  from collections import abc
38
38
  from contextlib import contextmanager
39
39
  from types import NotImplementedType, TracebackType
40
- from typing import (
41
- Any,
42
- Never,
43
- Optional,
44
- Protocol,
45
- Self,
46
- SupportsIndex,
47
- overload,
48
- )
40
+ from typing import Any, Never, Protocol, Self, SupportsIndex, overload
49
41
 
50
42
  import setdoc
51
43
  from frozendict import frozendict
@@ -87,7 +79,7 @@ class Collection_Frozen[Item](
87
79
  def __contains__(self: Self, other: Never, /) -> bool: ...
88
80
 
89
81
 
90
- class MutableSet_Mutable[Item: abc.Hashable](Protocol):
82
+ class SupportsAddAndDiscard[Item: abc.Hashable](Protocol):
91
83
  @setdoc.basic
92
84
  def add(self: Self, item: Item, /) -> object: ...
93
85
  @setdoc.basic
@@ -97,14 +89,14 @@ class MutableSet_Mutable[Item: abc.Hashable](Protocol):
97
89
  class Mapping_Frozen[Key, Value](Collection_Frozen[Key], Protocol):
98
90
  @setdoc.basic
99
91
  def __getitem__(self: Self, key: Never, /) -> Value: ...
100
- class MutableMapping_Mutable[Key_, Value_](
92
+ class SupportsDelitemAndSetitem[Key, Value](
101
93
  Protocol,
102
94
  ):
103
95
  @setdoc.basic
104
- def __delitem__(self: Self, key: Key_ | str, /) -> object: ...
96
+ def __delitem__(self: Self, key: Key | str, /) -> object: ...
105
97
  @setdoc.basic
106
98
  def __setitem__(
107
- self: Self, key: Key_ | str, value: Optional[Value_], /
99
+ self: Self, key: Key | str, value: Value | None, /
108
100
  ) -> object: ...
109
101
  class Sequence_Frozen[Item](
110
102
  Collection_Frozen[Item],
@@ -170,16 +162,16 @@ class MutableSequence_Mutable[Item](Protocol):
170
162
 
171
163
  ### TYPE ALIASES ###
172
164
 
173
- type Dict[Key, Value] = dict[Key | str, Optional[Value]]
165
+ type Dict[Key, Value] = dict[Key | str, Value | None]
174
166
 
175
167
  type Dict_Init[Key, Value] = (
176
- SupportsKeysAndGetitem[Key | str, Optional[Value]]
177
- | abc.Iterable[tuple[Key | str, Optional[Value]]]
168
+ SupportsKeysAndGetitem[Key | str, Value | None]
169
+ | abc.Iterable[tuple[Key | str, Value | None]]
178
170
  )
179
171
 
180
- type FrozenDict[Key, Value] = frozendict[Key | str, Optional[Value]]
172
+ type FrozenDict[Key, Value] = frozendict[Key | str, Value | None]
181
173
 
182
- type Slice[Index] = slice[Optional[Index], Optional[Index], Optional[Index]]
174
+ type Slice[Index] = slice[Index | None, Index | None, Index | None]
183
175
 
184
176
 
185
177
  ### OBJECT ###
@@ -299,7 +291,7 @@ class Set[Item: abc.Hashable](Collection[Item], abc.Set[Item]):
299
291
  class MutableSet[Item: abc.Hashable](
300
292
  Set[Item],
301
293
  abc.MutableSet[Item],
302
- MutableObject[Collection_Frozen[Item], MutableSet_Mutable[Item]],
294
+ MutableObject[Collection_Frozen[Item], SupportsAddAndDiscard[Item]],
303
295
  ):
304
296
  """Provide abc for custom mutable set."""
305
297
 
@@ -470,13 +462,13 @@ class Mapping[Key: abc.Hashable, Value](
470
462
  raise KeyError(key) from None
471
463
 
472
464
  @overload
473
- def get(self, key: object) -> Optional[Value]: ...
465
+ def get(self, key: object) -> Value | None: ...
474
466
  @overload
475
467
  def get[Value_](self, key: object, default: Value_) -> Value | Value_: ...
476
468
  @setdoc.basic
477
469
  def get[Value_](
478
- self: Self, key: object, default: Optional[Value_] = None
479
- ) -> Optional[Value | Value_]:
470
+ self: Self, key: object, default: Value_ | None = None
471
+ ) -> Value | Value_ | None:
480
472
  # this method is just as Mapping.get
481
473
  # with the signature corrected
482
474
  try:
@@ -487,8 +479,11 @@ class Mapping[Key: abc.Hashable, Value](
487
479
 
488
480
  class MutableMapping[Key: abc.Hashable, Value](
489
481
  Mapping[Key, Value],
490
- abc.MutableMapping[Key | str, Optional[Value]],
491
- MutableObject[FrozenDict[Key, Value], Dict[Key, Value]],
482
+ abc.MutableMapping[Key | str, Value | None],
483
+ MutableObject[
484
+ Mapping_Frozen[Key | str, Value | None],
485
+ SupportsDelitemAndSetitem[Key | str, Value | None],
486
+ ],
492
487
  ):
493
488
  """Provide abc for custom mutable mapping."""
494
489
 
@@ -501,7 +496,7 @@ class MutableMapping[Key: abc.Hashable, Value](
501
496
 
502
497
  @setdoc.basic
503
498
  def __setitem__(
504
- self: Self, key: Key | str, value: Optional[Value], /
499
+ self: Self, key: Key | str, value: Value | None, /
505
500
  ) -> None:
506
501
  with self.__mutate__() as mutable:
507
502
  mutable[key] = value
@@ -511,7 +506,7 @@ class MutableMapping[Key: abc.Hashable, Value](
511
506
 
512
507
 
513
508
  class DictLike[Key: abc.Hashable, Value](
514
- Mapping[Key | str, Optional[Value]],
509
+ Mapping[Key | str, Value | None],
515
510
  ):
516
511
  """Provide abc for custom dict-like."""
517
512
 
@@ -549,7 +544,7 @@ class DictLike[Key: abc.Hashable, Value](
549
544
  def fromkeys(
550
545
  cls: type[Self],
551
546
  iterable: abc.Iterable[Key | str],
552
- value: Optional[Value] = None,
547
+ value: Value | None = None,
553
548
  /,
554
549
  ) -> Self:
555
550
  return cls(dict.fromkeys(iterable, value))
@@ -586,7 +581,7 @@ class MutableDictLike[Key: abc.Hashable, Value](
586
581
  self: Self,
587
582
  other: Dict_Init[Key, Value] = (),
588
583
  /,
589
- **kwargs: Optional[Value],
584
+ **kwargs: Value | None,
590
585
  ):
591
586
  self.update(other, **kwargs)
592
587
 
@@ -601,7 +596,7 @@ class MutableDictLike[Key: abc.Hashable, Value](
601
596
  return self
602
597
 
603
598
  @setdoc.basic
604
- def popitem(self: Self, /) -> tuple[Key | str, Optional[Value]]:
599
+ def popitem(self: Self, /) -> tuple[Key | str, Value | None]:
605
600
  # for most dict d
606
601
  # dict.popitem(d) and collections.abc.MutableMapping.popitem(d)
607
602
  # behave differently
@@ -625,7 +620,7 @@ class FrozenDictSlot[Key: abc.Hashable, Value](
625
620
  self: Self,
626
621
  other: Dict_Init[Key, Value] = (),
627
622
  /,
628
- **kwargs: Optional[Value],
623
+ **kwargs: Value | None,
629
624
  ) -> None:
630
625
  self._slot = frozendict(other, **kwargs) # type: ignore[arg-type]
631
626
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datahold
3
- Version: 4.0.0.dev29
3
+ Version: 4.0.0.dev30
4
4
  Summary: This project wraps common mutable datastructures for inheritance with modification.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License-Expression: MIT
File without changes