classcore 1.14__tar.gz → 1.15__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.
- {classcore-1.14 → classcore-1.15}/PKG-INFO +1 -1
- {classcore-1.14 → classcore-1.15}/sources/classcore/__/nomina.py +24 -5
- {classcore-1.14 → classcore-1.15}/sources/classcore/__init__.py +1 -1
- {classcore-1.14 → classcore-1.15}/sources/classcore/nomina.py +5 -2
- {classcore-1.14 → classcore-1.15}/sources/classcore/standard/nomina.py +1 -0
- {classcore-1.14 → classcore-1.15}/.gitignore +0 -0
- {classcore-1.14 → classcore-1.15}/LICENSE.txt +0 -0
- {classcore-1.14 → classcore-1.15}/README.rst +0 -0
- {classcore-1.14 → classcore-1.15}/pyproject.toml +0 -0
- {classcore-1.14 → classcore-1.15}/sources/classcore/README.md +0 -0
- {classcore-1.14 → classcore-1.15}/sources/classcore/__/__init__.py +0 -0
- {classcore-1.14 → classcore-1.15}/sources/classcore/__/doctab.py +0 -0
- {classcore-1.14 → classcore-1.15}/sources/classcore/__/imports.py +0 -0
- {classcore-1.14 → classcore-1.15}/sources/classcore/decorators.py +0 -0
- {classcore-1.14 → classcore-1.15}/sources/classcore/exceptions.py +0 -0
- {classcore-1.14 → classcore-1.15}/sources/classcore/factories.py +0 -0
- {classcore-1.14 → classcore-1.15}/sources/classcore/py.typed +0 -0
- {classcore-1.14 → classcore-1.15}/sources/classcore/standard/README.md +0 -0
- {classcore-1.14 → classcore-1.15}/sources/classcore/standard/__.py +0 -0
- {classcore-1.14 → classcore-1.15}/sources/classcore/standard/__init__.py +0 -0
- {classcore-1.14 → classcore-1.15}/sources/classcore/standard/behaviors.py +0 -0
- {classcore-1.14 → classcore-1.15}/sources/classcore/standard/classes.py +0 -0
- {classcore-1.14 → classcore-1.15}/sources/classcore/standard/decorators.py +0 -0
- {classcore-1.14 → classcore-1.15}/sources/classcore/standard/dynadoc.py +0 -0
- {classcore-1.14 → classcore-1.15}/sources/classcore/standard/explanations.py +0 -0
- {classcore-1.14 → classcore-1.15}/sources/classcore/standard/modules.py +0 -0
- {classcore-1.14 → classcore-1.15}/sources/classcore/utilities.py +0 -0
|
@@ -51,13 +51,32 @@ class AttrnameCalculator:
|
|
|
51
51
|
|
|
52
52
|
Reference implementation of the attribute namer convention:
|
|
53
53
|
call instances to produce names, and consult ``is_internal_name``
|
|
54
|
-
to detect names this framework generated.
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
to detect names this framework generated. The package prefix is
|
|
55
|
+
construction-time configuration (default: this package):
|
|
56
|
+
downstream packages construct with their own prefix rather
|
|
57
|
+
than overriding either method, and it is read-only
|
|
58
|
+
thereafter: assignment raises, so a registered prefix cannot
|
|
59
|
+
drift. Detection consults the reserved
|
|
60
|
+
framework grammar (shape conformance, not proof of
|
|
61
|
+
generation); generation emits the class-level mangling stems
|
|
62
|
+
whose bare forms the detector does not accept. Downstream
|
|
63
|
+
callers writing conformance or drift tests can detect a
|
|
64
|
+
generated name without the private mangled-core vocabulary:
|
|
65
|
+
try the bare form first, then the form with 64 'a'
|
|
66
|
+
characters appended, which covers the two class-level
|
|
67
|
+
mangling stems the bare form never matches.
|
|
57
68
|
'''
|
|
58
69
|
|
|
70
|
+
def __init__( self, package_name: str = package_name ) -> None:
|
|
71
|
+
self._package_name = package_name
|
|
72
|
+
|
|
73
|
+
@property
|
|
74
|
+
def package_name( self ) -> str:
|
|
75
|
+
''' Package prefix this calculator generates and detects. '''
|
|
76
|
+
return self._package_name
|
|
77
|
+
|
|
59
78
|
def is_internal_name( self, name: str ) -> bool:
|
|
60
|
-
prefix = f"_{package_name}_"
|
|
79
|
+
prefix = f"_{self.package_name}_"
|
|
61
80
|
if not name.startswith( prefix ):
|
|
62
81
|
return False
|
|
63
82
|
body = name[ len( prefix ): ]
|
|
@@ -84,7 +103,7 @@ class AttrnameCalculator:
|
|
|
84
103
|
return False
|
|
85
104
|
|
|
86
105
|
def __call__( self, level: str, core: str ) -> str:
|
|
87
|
-
return f"_{package_name}_{level}_{core}_"
|
|
106
|
+
return f"_{self.package_name}_{level}_{core}_"
|
|
88
107
|
|
|
89
108
|
|
|
90
109
|
calculate_attrname = AttrnameCalculator( )
|
|
@@ -29,8 +29,11 @@ AttributesNamer: __.typx.TypeAlias = __.typx.Annotated[
|
|
|
29
29
|
__.ddoc.Doc(
|
|
30
30
|
''' Names attribute from level and core arguments.
|
|
31
31
|
|
|
32
|
-
Level will be one of 'class', '
|
|
33
|
-
Core will be
|
|
32
|
+
Level will be one of 'class', 'classes', 'instance', or
|
|
33
|
+
'instances'. Core will be one of the framework cores
|
|
34
|
+
named in the attribute-namer grammar (mutables and
|
|
35
|
+
visibles rules, assigner, deleter, and surveyor cores,
|
|
36
|
+
and construction bookkeeping).
|
|
34
37
|
|
|
35
38
|
Can be used by downstream packages to determine names of
|
|
36
39
|
bookkeeping attributes assigned by this package.
|
|
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
|