frigid 4.2__tar.gz → 4.4__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.
- frigid-4.4/.gitignore +7 -0
- {frigid-4.2 → frigid-4.4}/PKG-INFO +13 -8
- {frigid-4.2 → frigid-4.4}/README.rst +6 -0
- {frigid-4.2 → frigid-4.4}/pyproject.toml +28 -13
- frigid-4.4/sources/frigid/README.md +119 -0
- {frigid-4.2 → frigid-4.4}/sources/frigid/__/imports.py +2 -1
- {frigid-4.2 → frigid-4.4}/sources/frigid/__/nomina.py +7 -16
- {frigid-4.2 → frigid-4.4}/sources/frigid/__init__.py +2 -2
- {frigid-4.2 → frigid-4.4}/sources/frigid/classes.py +6 -12
- {frigid-4.2 → frigid-4.4}/sources/frigid/dictionaries.py +8 -2
- {frigid-4.2 → frigid-4.4}/sources/frigid/namespaces.py +2 -2
- frigid-4.2/.gitignore +0 -15
- {frigid-4.2 → frigid-4.4}/LICENSE.txt +0 -0
- {frigid-4.2 → frigid-4.4}/sources/frigid/__/__init__.py +0 -0
- {frigid-4.2 → frigid-4.4}/sources/frigid/__/dictionaries.py +0 -0
- {frigid-4.2 → frigid-4.4}/sources/frigid/__/doctab.py +0 -0
- {frigid-4.2 → frigid-4.4}/sources/frigid/__/exceptions.py +0 -0
- {frigid-4.2 → frigid-4.4}/sources/frigid/_typedecls/__builtins__.pyi +0 -0
- {frigid-4.2 → frigid-4.4}/sources/frigid/exceptions.py +0 -0
- {frigid-4.2 → frigid-4.4}/sources/frigid/installers.py +0 -0
- {frigid-4.2 → frigid-4.4}/sources/frigid/modules.py +0 -0
- {frigid-4.2 → frigid-4.4}/sources/frigid/py.typed +0 -0
- {frigid-4.2 → frigid-4.4}/sources/frigid/sequences.py +0 -0
frigid-4.4/.gitignore
ADDED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: frigid
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.4
|
|
4
4
|
Summary: Immutable data structures.
|
|
5
5
|
Project-URL: Homepage, https://github.com/emcd/python-frigid
|
|
6
6
|
Project-URL: Documentation, https://emcd.github.io/python-frigid
|
|
@@ -15,17 +15,16 @@ Classifier: Development Status :: 5 - Production/Stable
|
|
|
15
15
|
Classifier: Intended Audience :: Developers
|
|
16
16
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
17
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
20
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
19
|
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
22
22
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
23
|
-
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
24
23
|
Classifier: Topic :: Software Development
|
|
25
|
-
Requires-Python: >=3.
|
|
24
|
+
Requires-Python: >=3.12
|
|
26
25
|
Requires-Dist: absence~=1.1
|
|
27
|
-
Requires-Dist: classcore~=1.
|
|
28
|
-
Requires-Dist: dynadoc~=1.
|
|
26
|
+
Requires-Dist: classcore~=1.14
|
|
27
|
+
Requires-Dist: dynadoc~=1.4
|
|
29
28
|
Requires-Dist: typing-extensions
|
|
30
29
|
Description-Content-Type: text/x-rst
|
|
31
30
|
|
|
@@ -282,6 +281,9 @@ Other Projects by This Author 🌟
|
|
|
282
281
|
* `python-classcore <https://github.com/emcd/python-classcore>`_ (`classcore <https://pypi.org/project/classcore/>`_ on PyPI)
|
|
283
282
|
|
|
284
283
|
🏭 A Python library package which provides **foundational class factories and decorators** for providing classes with attributes immutability and concealment and other custom behaviors.
|
|
284
|
+
* `python-detextive <https://github.com/emcd/python-detextive>`_ (`detextive <https://pypi.org/project/detextive/>`_ on PyPI)
|
|
285
|
+
|
|
286
|
+
🕵️ A Python library which provides consolidated text detection capabilities for reliable content analysis. Offers MIME type detection, character set detection, and line separator processing.
|
|
285
287
|
* `python-dynadoc <https://github.com/emcd/python-dynadoc>`_ (`dynadoc <https://pypi.org/project/dynadoc/>`_ on PyPI)
|
|
286
288
|
|
|
287
289
|
📝 A Python library package which bridges the gap between **rich annotations** and **automatic documentation generation** with configurable renderers and support for reusable fragments.
|
|
@@ -291,6 +293,9 @@ Other Projects by This Author 🌟
|
|
|
291
293
|
* `python-icecream-truck <https://github.com/emcd/python-icecream-truck>`_ (`icecream-truck <https://pypi.org/project/icecream-truck/>`_ on PyPI)
|
|
292
294
|
|
|
293
295
|
🍦 **Flavorful Debugging** - A Python library which enhances the powerful and well-known ``icecream`` package with flavored traces, configuration hierarchies, customized outputs, ready-made recipes, and more.
|
|
296
|
+
* `python-librovore <https://github.com/emcd/python-librovore>`_ (`librovore <https://pypi.org/project/librovore/>`_ on PyPI)
|
|
297
|
+
|
|
298
|
+
🐲 **Documentation Search Engine** - An intelligent documentation search and extraction tool that provides both a command-line interface for humans and an MCP (Model Context Protocol) server for AI agents. Search across Sphinx and MkDocs sites with fuzzy matching, extract clean markdown content, and integrate seamlessly with AI development workflows.
|
|
294
299
|
* `python-mimeogram <https://github.com/emcd/python-mimeogram>`_ (`mimeogram <https://pypi.org/project/mimeogram/>`_ on PyPI)
|
|
295
300
|
|
|
296
301
|
📨 A command-line tool for **exchanging collections of files with Large Language Models** - bundle multiple files into a single clipboard-ready document while preserving directory structure and metadata... good for code reviews, project sharing, and LLM interactions.
|
|
@@ -251,6 +251,9 @@ Other Projects by This Author 🌟
|
|
|
251
251
|
* `python-classcore <https://github.com/emcd/python-classcore>`_ (`classcore <https://pypi.org/project/classcore/>`_ on PyPI)
|
|
252
252
|
|
|
253
253
|
🏭 A Python library package which provides **foundational class factories and decorators** for providing classes with attributes immutability and concealment and other custom behaviors.
|
|
254
|
+
* `python-detextive <https://github.com/emcd/python-detextive>`_ (`detextive <https://pypi.org/project/detextive/>`_ on PyPI)
|
|
255
|
+
|
|
256
|
+
🕵️ A Python library which provides consolidated text detection capabilities for reliable content analysis. Offers MIME type detection, character set detection, and line separator processing.
|
|
254
257
|
* `python-dynadoc <https://github.com/emcd/python-dynadoc>`_ (`dynadoc <https://pypi.org/project/dynadoc/>`_ on PyPI)
|
|
255
258
|
|
|
256
259
|
📝 A Python library package which bridges the gap between **rich annotations** and **automatic documentation generation** with configurable renderers and support for reusable fragments.
|
|
@@ -260,6 +263,9 @@ Other Projects by This Author 🌟
|
|
|
260
263
|
* `python-icecream-truck <https://github.com/emcd/python-icecream-truck>`_ (`icecream-truck <https://pypi.org/project/icecream-truck/>`_ on PyPI)
|
|
261
264
|
|
|
262
265
|
🍦 **Flavorful Debugging** - A Python library which enhances the powerful and well-known ``icecream`` package with flavored traces, configuration hierarchies, customized outputs, ready-made recipes, and more.
|
|
266
|
+
* `python-librovore <https://github.com/emcd/python-librovore>`_ (`librovore <https://pypi.org/project/librovore/>`_ on PyPI)
|
|
267
|
+
|
|
268
|
+
🐲 **Documentation Search Engine** - An intelligent documentation search and extraction tool that provides both a command-line interface for humans and an MCP (Model Context Protocol) server for AI agents. Search across Sphinx and MkDocs sites with fuzzy matching, extract clean markdown content, and integrate seamlessly with AI development workflows.
|
|
263
269
|
* `python-mimeogram <https://github.com/emcd/python-mimeogram>`_ (`mimeogram <https://pypi.org/project/mimeogram/>`_ on PyPI)
|
|
264
270
|
|
|
265
271
|
📨 A command-line tool for **exchanging collections of files with Large Language Models** - bundle multiple files into a single clipboard-ready document while preserving directory structure and metadata... good for code reviews, project sharing, and LLM interactions.
|
|
@@ -13,11 +13,11 @@ description = 'Immutable data structures.'
|
|
|
13
13
|
dynamic = [ 'version' ]
|
|
14
14
|
license = 'Apache-2.0'
|
|
15
15
|
readme = { 'file' = 'README.rst', 'content-type' = 'text/x-rst' }
|
|
16
|
-
requires-python = '>= 3.
|
|
16
|
+
requires-python = '>= 3.12'
|
|
17
17
|
dependencies = [
|
|
18
18
|
'absence~=1.1',
|
|
19
|
-
'classcore~=1.
|
|
20
|
-
'dynadoc~=1.
|
|
19
|
+
'classcore~=1.14',
|
|
20
|
+
'dynadoc~=1.4',
|
|
21
21
|
'typing-extensions',
|
|
22
22
|
# --- BEGIN: Injected by Copier ---
|
|
23
23
|
# --- END: Injected by Copier ---
|
|
@@ -28,12 +28,11 @@ classifiers = [ # https://pypi.org/classifiers
|
|
|
28
28
|
'License :: OSI Approved :: Apache Software License',
|
|
29
29
|
'Programming Language :: Python :: 3 :: Only',
|
|
30
30
|
# --- BEGIN: Injected by Copier ---
|
|
31
|
-
'Programming Language :: Python :: 3.10',
|
|
32
|
-
'Programming Language :: Python :: 3.11',
|
|
33
31
|
'Programming Language :: Python :: 3.12',
|
|
34
32
|
'Programming Language :: Python :: 3.13',
|
|
33
|
+
'Programming Language :: Python :: 3.14',
|
|
34
|
+
'Programming Language :: Python :: 3.15',
|
|
35
35
|
'Programming Language :: Python :: Implementation :: CPython',
|
|
36
|
-
'Programming Language :: Python :: Implementation :: PyPy',
|
|
37
36
|
# --- END: Injected by Copier ---
|
|
38
37
|
'Topic :: Software Development',
|
|
39
38
|
]
|
|
@@ -92,15 +91,16 @@ strict-naming = false
|
|
|
92
91
|
# --- BEGIN: Injected by Copier ---
|
|
93
92
|
# --- END: Injected by Copier ---
|
|
94
93
|
[tool.hatch.envs.default]
|
|
95
|
-
python = '3.
|
|
94
|
+
python = '3.12'
|
|
96
95
|
[tool.hatch.envs.develop]
|
|
97
96
|
description = ''' Development environment. '''
|
|
97
|
+
builder = true
|
|
98
98
|
dependencies = [
|
|
99
|
-
'Jinja2',
|
|
100
99
|
'coverage[toml]',
|
|
100
|
+
'emcd-vibe-linter~=1.0a2',
|
|
101
101
|
'furo',
|
|
102
102
|
'isort',
|
|
103
|
-
'
|
|
103
|
+
'myst-parser',
|
|
104
104
|
'pre-commit',
|
|
105
105
|
'pyright',
|
|
106
106
|
'pytest',
|
|
@@ -128,13 +128,21 @@ docsgen = [
|
|
|
128
128
|
"""sphinx-build -a -d .auxiliary/caches/sphinx --quiet \
|
|
129
129
|
documentation .auxiliary/artifacts/sphinx-html""",
|
|
130
130
|
]
|
|
131
|
+
fragments = [
|
|
132
|
+
"""python .auxiliary/scripts/validate-fragments.py""",
|
|
133
|
+
]
|
|
134
|
+
module-sizes = [
|
|
135
|
+
"""python .auxiliary/scripts/validate-module-sizes.py""",
|
|
136
|
+
]
|
|
131
137
|
linters = [
|
|
132
138
|
"""ruff check --quiet sources documentation tests""",
|
|
139
|
+
"""vibelinter check""",
|
|
133
140
|
# --- BEGIN: Injected by Copier ---
|
|
134
141
|
# --- END: Injected by Copier ---
|
|
135
142
|
"""isort --check-only --diff sources tests""",
|
|
136
|
-
"""vulture""",
|
|
137
143
|
"""pyright sources""",
|
|
144
|
+
'fragments',
|
|
145
|
+
'module-sizes',
|
|
138
146
|
]
|
|
139
147
|
packagers = [
|
|
140
148
|
"""hatch build""",
|
|
@@ -171,11 +179,10 @@ description = ''' Quality assurance environment. '''
|
|
|
171
179
|
template = 'develop'
|
|
172
180
|
[[tool.hatch.envs.qa.matrix]]
|
|
173
181
|
python = [
|
|
174
|
-
'3.10',
|
|
175
|
-
'3.11',
|
|
176
182
|
'3.12',
|
|
177
183
|
'3.13',
|
|
178
|
-
'
|
|
184
|
+
'3.14',
|
|
185
|
+
'3.15',
|
|
179
186
|
]
|
|
180
187
|
[tool.hatch.version]
|
|
181
188
|
path = 'sources/frigid/__init__.py'
|
|
@@ -348,6 +355,14 @@ directory = 'repair'
|
|
|
348
355
|
name = 'Repairs'
|
|
349
356
|
showcontent = true
|
|
350
357
|
|
|
358
|
+
[tool.vibelinter]
|
|
359
|
+
context = 3
|
|
360
|
+
exclude_paths = [ '.auxiliary/**', '.venv/**', 'tests/**', ]
|
|
361
|
+
[tool.vibelinter.rules.VBL201]
|
|
362
|
+
hub_patterns = [
|
|
363
|
+
'__init__.py', '__main__.py', '__.py', '__/imports.py', '__/nomina.py',
|
|
364
|
+
]
|
|
365
|
+
|
|
351
366
|
[tool.vulture]
|
|
352
367
|
paths = [ '.auxiliary/configuration/vulturefood.py', 'sources' ]
|
|
353
368
|
min_confidence = 60
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# frigid
|
|
2
|
+
|
|
3
|
+
Immutable data structures for Python. Provides collections and class behaviors
|
|
4
|
+
that cannot be modified after creation.
|
|
5
|
+
|
|
6
|
+
## Architecture
|
|
7
|
+
|
|
8
|
+
Layered architecture with three tiers:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
┌─────────────────────────────────────────────────┐
|
|
12
|
+
│ Public API │
|
|
13
|
+
│ (Dictionary, Namespace, Object, decorators) │
|
|
14
|
+
└─────────────────────────────────────────────────┘
|
|
15
|
+
↓
|
|
16
|
+
┌─────────────────────────────────────────────────┐
|
|
17
|
+
│ Core Implementation (*/) │
|
|
18
|
+
│ (ImmutableDictionary, type aliases, doc frags) │
|
|
19
|
+
└─────────────────────────────────────────────────┘
|
|
20
|
+
↓
|
|
21
|
+
┌─────────────────────────────────────────────────┐
|
|
22
|
+
│ Foundation Libraries │
|
|
23
|
+
│ (classcore, dynadoc, absence) │
|
|
24
|
+
└─────────────────────────────────────────────────┘
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
All modules follow the `__` import pattern: public modules import from
|
|
28
|
+
`. import __`, which provides centralized access to external dependencies.
|
|
29
|
+
|
|
30
|
+
## Modules
|
|
31
|
+
|
|
32
|
+
### Public API (`sources/frigid/`)
|
|
33
|
+
|
|
34
|
+
| Module | Purpose |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `__init__.py` | Package entry point; re-exports public API |
|
|
37
|
+
| `classes.py` | Metaclasses (`Class`, `Dataclass`, `AbstractBaseClass`, `Protocol*`) and decorators (`with_standard_behaviors`, `dataclass_with_standard_behaviors`) |
|
|
38
|
+
| `dictionaries.py` | `Dictionary`, `ValidatorDictionary` with set operations (`\|`, `&`) |
|
|
39
|
+
| `namespaces.py` | `Namespace` — like `SimpleNamespace`, but immutable |
|
|
40
|
+
| `modules.py` | `Module` type and `finalize_module()` utility |
|
|
41
|
+
| `sequences.py` | `one()` — single-item tuple factory |
|
|
42
|
+
| `exceptions.py` | `Omniexception` → `Omnierror` → `AttributeImmutability`, `EntryImmutability`, `EntryInvalidity` |
|
|
43
|
+
| `installers.py` | Utilities for installing into builtins |
|
|
44
|
+
|
|
45
|
+
### Internal (`sources/frigid/__/`)
|
|
46
|
+
|
|
47
|
+
| Module | Purpose |
|
|
48
|
+
|---|---|
|
|
49
|
+
| `imports.py` | Centralized external library imports |
|
|
50
|
+
| `nomina.py` | Type aliases, type variables, `calculate_attrname()` |
|
|
51
|
+
| `dictionaries.py` | `ImmutableDictionary` — core dict subclass with immutability enforcement |
|
|
52
|
+
| `doctab.py` | Documentation fragments table for dynadoc |
|
|
53
|
+
| `exceptions.py` | Internal exception classes |
|
|
54
|
+
|
|
55
|
+
## Key Patterns
|
|
56
|
+
|
|
57
|
+
**Wrapper Pattern**: `Dictionary` wraps `ImmutableDictionary` in `_data_`.
|
|
58
|
+
`Namespace` uses `ImmutableDictionary` for `__dict__`.
|
|
59
|
+
|
|
60
|
+
**Delegation Pattern**: Core immutability enforcement delegated to
|
|
61
|
+
`classcore.standard.class_factory`. Frigid provides configuration (attribute
|
|
62
|
+
naming, dynadoc, error classes) via `functools.partial`.
|
|
63
|
+
|
|
64
|
+
**Behavioral Flags**: `ImmutableDictionary` uses `_behaviors_` set to track
|
|
65
|
+
state. During `__init__`, immutability is not active. After `__init__`,
|
|
66
|
+
`'immutability'` is added to the set and all mutations are blocked.
|
|
67
|
+
|
|
68
|
+
**Template Method**: `Dictionary.with_data()` creates new instances with
|
|
69
|
+
same type and validator but different data. Subclasses override to maintain
|
|
70
|
+
behavior.
|
|
71
|
+
|
|
72
|
+
## Data Flow
|
|
73
|
+
|
|
74
|
+
### Initialization Flow
|
|
75
|
+
|
|
76
|
+
Immutable objects follow a consistent initialization pattern:
|
|
77
|
+
|
|
78
|
+
1. Object creation begins with `__new__`
|
|
79
|
+
2. During `__init__`, attributes/entries can be freely set
|
|
80
|
+
3. After `__init__` completes, protection activates via `__setattr__`/`__delattr__` overrides
|
|
81
|
+
4. Subsequent modification or deletion attempts raise immutability exceptions
|
|
82
|
+
|
|
83
|
+
For `ImmutableDictionary`, the `_behaviors_` set controls this: `'immutability'`
|
|
84
|
+
is absent during `__init__` (mutations allowed) and added after initialization.
|
|
85
|
+
|
|
86
|
+
### Dictionary Operation Flow
|
|
87
|
+
|
|
88
|
+
Set operations (union, intersection) maintain immutability guarantees:
|
|
89
|
+
|
|
90
|
+
1. User invokes operation: `dict1 | dict2`
|
|
91
|
+
2. Operation method computes new data (checks for key conflicts on union)
|
|
92
|
+
3. Method calls `with_data()` to create a new instance
|
|
93
|
+
4. New instance has the same type and validator (if applicable)
|
|
94
|
+
5. Returns a new immutable dictionary — originals are unchanged
|
|
95
|
+
|
|
96
|
+
## Dependencies
|
|
97
|
+
|
|
98
|
+
- **classcore** `~=1.11`: Class factory mechanism and attribute protection
|
|
99
|
+
- **dynadoc** `~=1.4`: Dynamic documentation generation with reusable fragments
|
|
100
|
+
- **absence** `~=1.1`: Sentinel for absent values (distinguishes missing from `None`)
|
|
101
|
+
- **typing-extensions**: Backported typing features
|
|
102
|
+
|
|
103
|
+
## Exception Hierarchy
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
Omniexception (BaseException)
|
|
107
|
+
└── Omnierror (Exception)
|
|
108
|
+
├── AttributeImmutability (+ AttributeError)
|
|
109
|
+
├── EntryImmutability (+ TypeError)
|
|
110
|
+
├── EntryInvalidity (+ ValueError)
|
|
111
|
+
└── ErrorProvideFailure (+ RuntimeError)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Dual inheritance allows catching via frigid's hierarchy or Python built-ins.
|
|
115
|
+
|
|
116
|
+
## Sister Projects
|
|
117
|
+
|
|
118
|
+
- **[classcore](https://github.com/emcd/python-classcore)** — Foundational class factory and behavior system. Provides the metaclass machinery, attribute protection, and concealment that frigid delegates to.
|
|
119
|
+
- **[accretive](https://github.com/emcd/python-accretive)** — Grow-only data structures. Like frigid, but values can be added (never modified or removed) after creation. Useful for registries, plugin systems, and sticky-state configurations.
|
|
@@ -26,10 +26,17 @@
|
|
|
26
26
|
from classcore.standard.nomina import ( # isort: skip
|
|
27
27
|
AttributesNamer,
|
|
28
28
|
BehaviorExclusionVerifiersOmni,
|
|
29
|
+
ClassDecorator,
|
|
30
|
+
ClassDecorators,
|
|
31
|
+
ClassDecoratorFactory,
|
|
29
32
|
DecorationPreparers as ClassDecorationPreparers,
|
|
30
33
|
DynadocConfiguration,
|
|
34
|
+
ModuleReclassifier,
|
|
35
|
+
abc_class_mutables,
|
|
31
36
|
concealment_label,
|
|
32
37
|
immutability_label,
|
|
38
|
+
is_public_identifier,
|
|
39
|
+
typing_class_mutables,
|
|
33
40
|
)
|
|
34
41
|
|
|
35
42
|
from . import imports as __
|
|
@@ -45,16 +52,6 @@ ComparisonResult: __.typx.TypeAlias = bool | __.types.NotImplementedType
|
|
|
45
52
|
NominativeArguments: __.typx.TypeAlias = __.cabc.Mapping[ str, __.typx.Any ]
|
|
46
53
|
PositionalArguments: __.typx.TypeAlias = __.cabc.Sequence[ __.typx.Any ]
|
|
47
54
|
|
|
48
|
-
# TODO: Import ClassDecorator aliases from 'classcore' once documentation
|
|
49
|
-
# fragments have been removed from them.
|
|
50
|
-
ClassDecorator: __.typx.TypeAlias = (
|
|
51
|
-
__.cabc.Callable[ [ type[ U ] ], type[ U ] ] )
|
|
52
|
-
ClassDecorators: __.typx.TypeAlias = (
|
|
53
|
-
__.cabc.Sequence[ ClassDecorator[ U ] ] )
|
|
54
|
-
ClassDecoratorFactory: __.typx.TypeAlias = (
|
|
55
|
-
__.cabc.Callable[ ..., ClassDecorator[ U ] ] )
|
|
56
|
-
ModuleReclassifier: __.typx.TypeAlias = __.cabc.Callable[
|
|
57
|
-
[ __.cabc.Mapping[ str, __.typx.Any ] ], None ]
|
|
58
55
|
|
|
59
56
|
DictionaryNominativeArgument: __.typx.TypeAlias = __.typx.Annotated[
|
|
60
57
|
V,
|
|
@@ -81,9 +78,3 @@ package_name = __name__.split( '.', maxsplit = 1 )[ 0 ]
|
|
|
81
78
|
|
|
82
79
|
def calculate_attrname( level: str, core: str ) -> str:
|
|
83
80
|
return f"_{package_name}_{level}_{core}_"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
# TODO: Import 'is_public_identifier' from 'classcore'.
|
|
87
|
-
def is_public_identifier( name: str ) -> bool:
|
|
88
|
-
''' Is Python identifier public? '''
|
|
89
|
-
return not name.startswith( '_' )
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
from . import __
|
|
30
|
-
# --- BEGIN: Injected by Copier ---
|
|
31
30
|
from . import exceptions
|
|
31
|
+
# --- BEGIN: Injected by Copier ---
|
|
32
32
|
# --- END: Injected by Copier ---
|
|
33
33
|
|
|
34
34
|
from .classes import *
|
|
@@ -40,7 +40,7 @@ from .sequences import *
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
__version__: __.typx.Annotated[ str, __.ddoc.Visibilities.Reveal ]
|
|
43
|
-
__version__ = '4.
|
|
43
|
+
__version__ = '4.4'
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
finalize_module( __name__, dynadoc_table = __.fragments, recursive = True )
|
|
@@ -26,12 +26,6 @@
|
|
|
26
26
|
from . import __
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
abc_class_mutables = (
|
|
30
|
-
'_abc_cache',
|
|
31
|
-
'_abc_negative_cache',
|
|
32
|
-
'_abc_negative_cache_version',
|
|
33
|
-
'_abc_registry',
|
|
34
|
-
)
|
|
35
29
|
is_public_identifier = __.is_public_identifier
|
|
36
30
|
mutables_default = ( )
|
|
37
31
|
visibles_default = ( is_public_identifier, )
|
|
@@ -161,7 +155,7 @@ class ProtocolClass( type( __.typx.Protocol ) ):
|
|
|
161
155
|
|
|
162
156
|
@_class_factory( )
|
|
163
157
|
@__.typx.dataclass_transform( frozen_default = True, kw_only_default = True )
|
|
164
|
-
class ProtocolDataclass(
|
|
158
|
+
class ProtocolDataclass( ProtocolClass ):
|
|
165
159
|
''' Metaclass for standard protocol dataclasses. '''
|
|
166
160
|
|
|
167
161
|
_dynadoc_fragments_ = (
|
|
@@ -182,7 +176,7 @@ class ProtocolDataclass( type( __.typx.Protocol ) ):
|
|
|
182
176
|
|
|
183
177
|
@_class_factory( )
|
|
184
178
|
@__.typx.dataclass_transform( kw_only_default = True )
|
|
185
|
-
class ProtocolDataclassMutable(
|
|
179
|
+
class ProtocolDataclassMutable( ProtocolDataclass ):
|
|
186
180
|
''' Metaclass for protocol dataclasses with mutable instances.
|
|
187
181
|
'''
|
|
188
182
|
|
|
@@ -239,7 +233,7 @@ class DataclassObjectMutable( metaclass = DataclassMutable ):
|
|
|
239
233
|
class Protocol(
|
|
240
234
|
__.typx.Protocol,
|
|
241
235
|
metaclass = ProtocolClass,
|
|
242
|
-
class_mutables = abc_class_mutables,
|
|
236
|
+
class_mutables = ( *__.abc_class_mutables, *__.typing_class_mutables ),
|
|
243
237
|
):
|
|
244
238
|
''' Standard base protocol class. '''
|
|
245
239
|
|
|
@@ -252,7 +246,7 @@ class Protocol(
|
|
|
252
246
|
class ProtocolMutable(
|
|
253
247
|
__.typx.Protocol,
|
|
254
248
|
metaclass = ProtocolClass,
|
|
255
|
-
class_mutables = abc_class_mutables,
|
|
249
|
+
class_mutables = ( *__.abc_class_mutables, *__.typing_class_mutables ),
|
|
256
250
|
instances_mutables = '*',
|
|
257
251
|
):
|
|
258
252
|
''' Base protocol class with mutable instance attributes. '''
|
|
@@ -266,7 +260,7 @@ class ProtocolMutable(
|
|
|
266
260
|
class DataclassProtocol(
|
|
267
261
|
__.typx.Protocol,
|
|
268
262
|
metaclass = ProtocolDataclass,
|
|
269
|
-
class_mutables = abc_class_mutables,
|
|
263
|
+
class_mutables = ( *__.abc_class_mutables, *__.typing_class_mutables ),
|
|
270
264
|
):
|
|
271
265
|
''' Standard base protocol dataclass. '''
|
|
272
266
|
|
|
@@ -279,7 +273,7 @@ class DataclassProtocol(
|
|
|
279
273
|
class DataclassProtocolMutable(
|
|
280
274
|
__.typx.Protocol,
|
|
281
275
|
metaclass = ProtocolDataclassMutable,
|
|
282
|
-
class_mutables = abc_class_mutables,
|
|
276
|
+
class_mutables = ( *__.abc_class_mutables, *__.typing_class_mutables ),
|
|
283
277
|
):
|
|
284
278
|
''' Base protocol dataclass with mutable instance attributes. '''
|
|
285
279
|
|
|
@@ -120,7 +120,13 @@ class _DictionaryOperations( AbstractDictionary[ __.H, __.V ] ):
|
|
|
120
120
|
|
|
121
121
|
def __ror__( self, other: __.cabc.Mapping[ __.H, __.V ] ) -> __.typx.Self:
|
|
122
122
|
if not isinstance( other, __.cabc.Mapping ): return NotImplemented
|
|
123
|
-
|
|
123
|
+
conflicts = set( self.keys( ) ) & set( other.keys( ) )
|
|
124
|
+
if conflicts:
|
|
125
|
+
from .exceptions import EntryImmutability
|
|
126
|
+
raise EntryImmutability( next( iter( conflicts ) ) )
|
|
127
|
+
data = dict( other )
|
|
128
|
+
data.update( self )
|
|
129
|
+
return self.with_data( data )
|
|
124
130
|
|
|
125
131
|
def __and__(
|
|
126
132
|
self,
|
|
@@ -162,7 +168,7 @@ class _DictionaryOperations( AbstractDictionary[ __.H, __.V ] ):
|
|
|
162
168
|
class Dictionary( # noqa: PLW1641
|
|
163
169
|
_DictionaryOperations[ __.H, __.V ],
|
|
164
170
|
metaclass = _classes.AbstractBaseClass,
|
|
165
|
-
class_mutables =
|
|
171
|
+
class_mutables = __.abc_class_mutables,
|
|
166
172
|
):
|
|
167
173
|
''' Immutable dictionary. '''
|
|
168
174
|
|
|
@@ -59,9 +59,9 @@ class Namespace( metaclass = _classes.Class ): # noqa: PLW1641
|
|
|
59
59
|
*iterables: __.DictionaryPositionalArgument[ __.H, __.V ],
|
|
60
60
|
**attributes: __.DictionaryNominativeArgument[ __.V ],
|
|
61
61
|
) -> None:
|
|
62
|
-
self.__dict__.update(
|
|
62
|
+
self.__dict__.update( # pyright: ignore
|
|
63
63
|
__.ImmutableDictionary(
|
|
64
|
-
*iterables, **attributes ) )
|
|
64
|
+
*iterables, **attributes ) )
|
|
65
65
|
super( ).__init__( )
|
|
66
66
|
|
|
67
67
|
def __repr__( self ) -> str:
|
frigid-4.2/.gitignore
DELETED
|
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
|