classcore 1.5.1__tar.gz → 1.5.3__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.5.1 → classcore-1.5.3}/PKG-INFO +1 -1
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/__init__.py +1 -1
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/standard/behaviors.py +9 -6
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/standard/decorators.py +6 -4
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/utilities.py +2 -2
- {classcore-1.5.1 → classcore-1.5.3}/.gitignore +0 -0
- {classcore-1.5.1 → classcore-1.5.3}/LICENSE.txt +0 -0
- {classcore-1.5.1 → classcore-1.5.3}/README.rst +0 -0
- {classcore-1.5.1 → classcore-1.5.3}/pyproject.toml +0 -0
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/__/__init__.py +0 -0
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/__/doctab.py +0 -0
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/__/imports.py +0 -0
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/__/nomina.py +0 -0
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/decorators.py +0 -0
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/exceptions.py +0 -0
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/factories.py +0 -0
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/nomina.py +0 -0
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/py.typed +0 -0
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/standard/__.py +0 -0
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/standard/__init__.py +0 -0
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/standard/classes.py +0 -0
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/standard/dynadoc.py +0 -0
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/standard/modules.py +0 -0
- {classcore-1.5.1 → classcore-1.5.3}/sources/classcore/standard/nomina.py +0 -0
|
@@ -182,6 +182,7 @@ def augment_class_attributes_allocations(
|
|
|
182
182
|
__.cabc.Sequence[ str ],
|
|
183
183
|
None
|
|
184
184
|
] = namespace.get( '__slots__' )
|
|
185
|
+
if slots and behaviors_name in slots: return
|
|
185
186
|
if isinstance( slots, __.cabc.Mapping ):
|
|
186
187
|
slots_ = dict( slots )
|
|
187
188
|
slots_[ behaviors_name ] = 'Active behaviors.'
|
|
@@ -255,12 +256,6 @@ def produce_class_construction_postprocessor(
|
|
|
255
256
|
) -> None:
|
|
256
257
|
arguments = getattr( cls, arguments_name, { } )
|
|
257
258
|
clscls = type( cls )
|
|
258
|
-
dynadoc_cfg = arguments.get( 'dynadoc_configuration', { } )
|
|
259
|
-
if not dynadoc_cfg: # either metaclass argument or attribute
|
|
260
|
-
dynadoc_cfg_name = (
|
|
261
|
-
attributes_namer( 'classes', 'dynadoc_configuration' ) )
|
|
262
|
-
dynadoc_cfg = getattr( clscls, dynadoc_cfg_name, { } )
|
|
263
|
-
decorators.append( __.ddoc.with_docstring( **dynadoc_cfg ) )
|
|
264
259
|
dcls_spec = getattr( cls, '__dataclass_transform__', None )
|
|
265
260
|
if not dcls_spec: # either base class or metaclass may be marked
|
|
266
261
|
dcls_spec = getattr( clscls, '__dataclass_transform__', None )
|
|
@@ -297,6 +292,14 @@ def produce_class_construction_postprocessor(
|
|
|
297
292
|
mutables = instances_mutables,
|
|
298
293
|
visibles = instances_visibles )
|
|
299
294
|
decorators.append( decorator )
|
|
295
|
+
# Dynadoc tracks objects in weakset.
|
|
296
|
+
# Must decorate after any potential class replacements.
|
|
297
|
+
dynadoc_cfg = arguments.get( 'dynadoc_configuration', { } )
|
|
298
|
+
if not dynadoc_cfg: # either metaclass argument or attribute
|
|
299
|
+
dynadoc_cfg_name = (
|
|
300
|
+
attributes_namer( 'classes', 'dynadoc_configuration' ) )
|
|
301
|
+
dynadoc_cfg = getattr( clscls, dynadoc_cfg_name, { } )
|
|
302
|
+
decorators.append( __.ddoc.with_docstring( **dynadoc_cfg ) )
|
|
300
303
|
|
|
301
304
|
return postprocess
|
|
302
305
|
|
|
@@ -47,11 +47,13 @@ def prepare_dataclass_for_instances(
|
|
|
47
47
|
''' Annotates dataclass in support of instantiation machinery. '''
|
|
48
48
|
annotations = __.inspect.get_annotations( cls )
|
|
49
49
|
behaviors_name = attributes_namer( 'instance', 'behaviors' )
|
|
50
|
-
# TODO
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
# TODO: Only use mangling if not slotted.
|
|
51
|
+
# behaviors_name_ = _utilities.mangle_name( cls, behaviors_name )
|
|
52
|
+
behaviors_name_ = behaviors_name
|
|
53
|
+
annotations[ behaviors_name_ ] = set[ str ]
|
|
53
54
|
setattr( cls, '__annotations__', annotations ) # in case of absence
|
|
54
|
-
setattr( cls,
|
|
55
|
+
setattr( cls, behaviors_name_, __.dcls.field(
|
|
56
|
+
compare = False, hash = False, init = False, repr = False ) )
|
|
55
57
|
|
|
56
58
|
|
|
57
59
|
def apply_cfc_core_functions(
|
|
@@ -99,11 +99,11 @@ def mangle_name( objct: object, /, name: str ) -> str:
|
|
|
99
99
|
# Need to debug weird issue with using 'id' early on dataclasses.
|
|
100
100
|
if not __.inspect.isclass( objct ):
|
|
101
101
|
return mangle_name( type( objct ), name )
|
|
102
|
-
# return "{name}
|
|
102
|
+
# return "{name}{uid}".format( name = name, uid = id( objct ) )
|
|
103
103
|
namehash = __.hashlib.sha256( )
|
|
104
104
|
namehash.update( qualify_class_name( objct ).encode( ) )
|
|
105
105
|
namehash_hex = namehash.hexdigest( )
|
|
106
|
-
return f"{name}
|
|
106
|
+
return f"{name}{namehash_hex}"
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
def qualify_class_name( cls: type ) -> str:
|
|
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
|