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.
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/PKG-INFO +1 -1
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/pyproject.toml +1 -1
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/src/datahold/__init__.py +25 -30
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/src/datahold.egg-info/PKG-INFO +1 -1
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/LICENSE.txt +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/MANIFEST.in +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/README.rst +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/docs/v1.1.rst +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/docs/v1.2.rst +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/docs/v2.0.rst +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/docs/v2.1.rst +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/docs/v2.2.rst +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/docs/v2.3.rst +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/docs/v3.0.rst +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/docs/v4.0.rst +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/run_tests.py +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/setup.cfg +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/src/datahold/py.typed +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/src/datahold.egg-info/SOURCES.txt +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/src/datahold.egg-info/dependency_links.txt +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/src/datahold.egg-info/requires.txt +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/src/datahold.egg-info/top_level.txt +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_FrozenDictSlot.py +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_FrozenListSlot.py +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_FrozenSetSlot.py +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_MutableDictSlot.py +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_MutableListSlot.py +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_MutableSetSlot.py +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_abstractmethods.py +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_all.py +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_attributes.py +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_docs.py +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_generic.py +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_issubclass.py +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_metaclass.py +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_name.py +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_nested.py +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_sorted.py +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/test_variance.py +0 -0
- {datahold-4.0.0.dev29 → datahold-4.0.0.dev30}/tests/testdata.toml +0 -0
|
@@ -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
|
|
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
|
|
92
|
+
class SupportsDelitemAndSetitem[Key, Value](
|
|
101
93
|
Protocol,
|
|
102
94
|
):
|
|
103
95
|
@setdoc.basic
|
|
104
|
-
def __delitem__(self: Self, key:
|
|
96
|
+
def __delitem__(self: Self, key: Key | str, /) -> object: ...
|
|
105
97
|
@setdoc.basic
|
|
106
98
|
def __setitem__(
|
|
107
|
-
self: Self, key:
|
|
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,
|
|
165
|
+
type Dict[Key, Value] = dict[Key | str, Value | None]
|
|
174
166
|
|
|
175
167
|
type Dict_Init[Key, Value] = (
|
|
176
|
-
SupportsKeysAndGetitem[Key | str,
|
|
177
|
-
| abc.Iterable[tuple[Key | str,
|
|
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,
|
|
172
|
+
type FrozenDict[Key, Value] = frozendict[Key | str, Value | None]
|
|
181
173
|
|
|
182
|
-
type Slice[Index] = slice[
|
|
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],
|
|
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) ->
|
|
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:
|
|
479
|
-
) ->
|
|
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,
|
|
491
|
-
MutableObject[
|
|
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:
|
|
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,
|
|
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:
|
|
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:
|
|
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,
|
|
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:
|
|
623
|
+
**kwargs: Value | None,
|
|
629
624
|
) -> None:
|
|
630
625
|
self._slot = frozendict(other, **kwargs) # type: ignore[arg-type]
|
|
631
626
|
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|