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.
Files changed (27) hide show
  1. {classcore-1.14 → classcore-1.15}/PKG-INFO +1 -1
  2. {classcore-1.14 → classcore-1.15}/sources/classcore/__/nomina.py +24 -5
  3. {classcore-1.14 → classcore-1.15}/sources/classcore/__init__.py +1 -1
  4. {classcore-1.14 → classcore-1.15}/sources/classcore/nomina.py +5 -2
  5. {classcore-1.14 → classcore-1.15}/sources/classcore/standard/nomina.py +1 -0
  6. {classcore-1.14 → classcore-1.15}/.gitignore +0 -0
  7. {classcore-1.14 → classcore-1.15}/LICENSE.txt +0 -0
  8. {classcore-1.14 → classcore-1.15}/README.rst +0 -0
  9. {classcore-1.14 → classcore-1.15}/pyproject.toml +0 -0
  10. {classcore-1.14 → classcore-1.15}/sources/classcore/README.md +0 -0
  11. {classcore-1.14 → classcore-1.15}/sources/classcore/__/__init__.py +0 -0
  12. {classcore-1.14 → classcore-1.15}/sources/classcore/__/doctab.py +0 -0
  13. {classcore-1.14 → classcore-1.15}/sources/classcore/__/imports.py +0 -0
  14. {classcore-1.14 → classcore-1.15}/sources/classcore/decorators.py +0 -0
  15. {classcore-1.14 → classcore-1.15}/sources/classcore/exceptions.py +0 -0
  16. {classcore-1.14 → classcore-1.15}/sources/classcore/factories.py +0 -0
  17. {classcore-1.14 → classcore-1.15}/sources/classcore/py.typed +0 -0
  18. {classcore-1.14 → classcore-1.15}/sources/classcore/standard/README.md +0 -0
  19. {classcore-1.14 → classcore-1.15}/sources/classcore/standard/__.py +0 -0
  20. {classcore-1.14 → classcore-1.15}/sources/classcore/standard/__init__.py +0 -0
  21. {classcore-1.14 → classcore-1.15}/sources/classcore/standard/behaviors.py +0 -0
  22. {classcore-1.14 → classcore-1.15}/sources/classcore/standard/classes.py +0 -0
  23. {classcore-1.14 → classcore-1.15}/sources/classcore/standard/decorators.py +0 -0
  24. {classcore-1.14 → classcore-1.15}/sources/classcore/standard/dynadoc.py +0 -0
  25. {classcore-1.14 → classcore-1.15}/sources/classcore/standard/explanations.py +0 -0
  26. {classcore-1.14 → classcore-1.15}/sources/classcore/standard/modules.py +0 -0
  27. {classcore-1.14 → classcore-1.15}/sources/classcore/utilities.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: classcore
3
- Version: 1.14
3
+ Version: 1.15
4
4
  Summary: Foundational class factories and decorators.
5
5
  Project-URL: Homepage, https://github.com/emcd/python-classcore
6
6
  Project-URL: Documentation, https://emcd.github.io/python-classcore
@@ -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. Downstream packages
55
- may subclass (or otherwise provide callables exposing the same
56
- optional detector) to contribute their own internal names.
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( )
@@ -62,7 +62,7 @@ from .factories import *
62
62
 
63
63
 
64
64
  __version__: __.typx.Annotated[ str, __.ddoc.Visibilities.Reveal ]
65
- __version__ = '1.14'
65
+ __version__ = '1.15'
66
66
 
67
67
 
68
68
  standard.finalize_module(
@@ -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', 'instances', or 'instance'.
33
- Core will be the core of the name as supplied this package.
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.
@@ -31,6 +31,7 @@ immutability_label = 'immutability'
31
31
 
32
32
  abc_class_mutables = __.abc_class_mutables
33
33
  typing_class_mutables = __.typing_class_mutables
34
+ AttrnameCalculator = __.AttrnameCalculator
34
35
 
35
36
 
36
37
  BehaviorExclusionNames: __.typx.TypeAlias = __.cabc.Set[ str ]
File without changes
File without changes
File without changes
File without changes