dtools.circular-array 3.14.0__py3-none-any.whl → 3.15.0__py3-none-any.whl
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.
- dtools/circular_array.py +12 -5
- {dtools_circular_array-3.14.0.dist-info → dtools_circular_array-3.15.0.dist-info}/METADATA +11 -15
- dtools_circular_array-3.15.0.dist-info/RECORD +5 -0
- dtools_circular_array-3.14.0.dist-info/RECORD +0 -5
- {dtools_circular_array-3.14.0.dist-info → dtools_circular_array-3.15.0.dist-info}/WHEEL +0 -0
- {dtools_circular_array-3.14.0.dist-info → dtools_circular_array-3.15.0.dist-info}/licenses/LICENSE +0 -0
dtools/circular_array.py
CHANGED
@@ -12,10 +12,18 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
-
"""
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
"""An indexable circular array data structure.
|
16
|
+
|
17
|
+
- generic, stateful, invariant data structure
|
18
|
+
- amortized O(1) pushing and popping from either end
|
19
|
+
- O(1) random access any element
|
20
|
+
- will resize itself as needed
|
21
|
+
- sliceable
|
22
|
+
- makes defensive copies of contents for the purposes of iteration
|
23
|
+
- in boolean context returns
|
24
|
+
- `True` when not empty
|
25
|
+
- `False` when empty
|
26
|
+
- in comparisons compare identity before equality, like builtins do
|
19
27
|
|
20
28
|
"""
|
21
29
|
|
@@ -36,7 +44,6 @@ D = TypeVar('D')
|
|
36
44
|
class CA[D]:
|
37
45
|
"""Indexable circular array data structure
|
38
46
|
|
39
|
-
- generic, stateful, invariant data structure
|
40
47
|
- amortized O(1) pushing and popping from either end
|
41
48
|
- O(1) random access any element
|
42
49
|
- will resize itself as needed
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: dtools.circular-array
|
3
|
-
Version: 3.
|
4
|
-
Summary:
|
3
|
+
Version: 3.15.0
|
4
|
+
Summary: An indexable circular array data structure.
|
5
5
|
Keywords: circular array,dequeue,pop,push,indexable,auto resizing
|
6
6
|
Author-email: "Geoffrey R. Scheller" <geoffrey@scheller.com>
|
7
7
|
Requires-Python: >=3.12
|
@@ -24,7 +24,8 @@ Provides-Extra: test
|
|
24
24
|
# Developer Tools - Circular Array
|
25
25
|
|
26
26
|
Python package containing a module implementing a circular array data
|
27
|
-
structure,
|
27
|
+
structure, This project is part of the [Developer Tools for Python][4]
|
28
|
+
**dtools** namespace projects.
|
28
29
|
|
29
30
|
- **Repositories**
|
30
31
|
- [dtools.circular-array][1] project on *PyPI*
|
@@ -32,31 +33,26 @@ structure,
|
|
32
33
|
- **Detailed documentation**
|
33
34
|
- [Detailed API documentation][3] on *GH-Pages*
|
34
35
|
|
35
|
-
This project is part of the [Developer Tools for Python][4] **dtools**
|
36
|
-
namespace projects.
|
37
|
-
|
38
36
|
## Overview
|
39
37
|
|
40
|
-
- O(1) amortized pushes and pops either end.
|
41
|
-
- O(1) indexing
|
42
|
-
- fully supports slicing
|
43
|
-
- safely mutates over previous state
|
44
|
-
|
45
|
-
### Module circular_array
|
46
|
-
|
47
38
|
A full featured auto resizing circular array data structure. Double
|
48
39
|
sided, indexable, sliceable, and iterable. When iterated, uses cached
|
49
40
|
copies of its present state so that the circular array itself can safely
|
50
41
|
be mutated.
|
51
42
|
|
43
|
+
- O(1) amortized pushes and pops either end.
|
44
|
+
- O(1) indexing
|
45
|
+
- fully supports slicing
|
46
|
+
- safely mutates over previous state
|
47
|
+
|
52
48
|
Useful either if used directly like a Python list, or in a "has-a"
|
53
49
|
relationship when implementing other data structures.
|
54
50
|
|
55
51
|
- *module* dtools.circular_array
|
56
52
|
- *class* `CA:` circular array data structure
|
57
53
|
- initializer takes 1 or 0 iterators
|
58
|
-
|
59
|
-
- *function* `ca`: produces a `CA` from function's arguments
|
54
|
+
- like `list` or `set` does
|
55
|
+
- *function* `ca`: produces a `CA` from the function's arguments
|
60
56
|
- similar use case as syntactic constructs `[]` or `{}`
|
61
57
|
|
62
58
|
Above nomenclature modeled after builtin data types like `list`, where
|
@@ -0,0 +1,5 @@
|
|
1
|
+
dtools/circular_array.py,sha256=01aPPNR-N0yVoo1U94AQH1zYCis4upKp4Zo0aQ_EIqM,16405
|
2
|
+
dtools_circular_array-3.15.0.dist-info/licenses/LICENSE,sha256=csqbZRvA3Nyuav1aszWvswE8CZtaKr-hMjjjcKqms7w,10774
|
3
|
+
dtools_circular_array-3.15.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
4
|
+
dtools_circular_array-3.15.0.dist-info/METADATA,sha256=byIqLKMsbJCiPQqVfQJqjtdAQdAugl_rb8OtdETS6Jc,3576
|
5
|
+
dtools_circular_array-3.15.0.dist-info/RECORD,,
|
@@ -1,5 +0,0 @@
|
|
1
|
-
dtools/circular_array.py,sha256=GJn30Xub6oSd2Ltiy76ccUytiNpVS43RJNU4Oax6EkM,16184
|
2
|
-
dtools_circular_array-3.14.0.dist-info/licenses/LICENSE,sha256=csqbZRvA3Nyuav1aszWvswE8CZtaKr-hMjjjcKqms7w,10774
|
3
|
-
dtools_circular_array-3.14.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
4
|
-
dtools_circular_array-3.14.0.dist-info/METADATA,sha256=PPfMaC0yPeiMRUp9rsXxFtEmw7mUVkJK-DAtffjKjhI,3597
|
5
|
-
dtools_circular_array-3.14.0.dist-info/RECORD,,
|
File without changes
|
{dtools_circular_array-3.14.0.dist-info → dtools_circular_array-3.15.0.dist-info}/licenses/LICENSE
RENAMED
File without changes
|