jangada.mixin.Describable#
- class jangada.mixin.Describable#
Bases:
objectMixin that adds a free-form description.
Provides a description attribute for extended context, documentation, or explanatory text. Descriptions can be multiline and have no length restrictions. They are intended for detailed information that doesn’t fit in a short name.
Like names, descriptions are normalized by stripping whitespace and converting empty strings to None.
- Attributes:
- descriptionstr or None
Free-form description text. Can be multiline and any length. Leading/trailing whitespace is stripped. Empty strings become None.
See also
NameableShort display name
Notes
- Use Cases
Detailed documentation
Usage instructions
Configuration notes
Context for debugging
Help text in UIs
- Formatting
No formatting is applied. If you need formatted text (markdown, HTML, etc.), store it as a string and format at display time.
- Length
No restrictions. Very long descriptions are allowed. Consider pagination or truncation in UI contexts.
Examples
Basic usage:
obj = Describable() obj.description = "This sensor monitors ambient temperature." print(obj.description)
Multiline descriptions:
obj.description = ''' This is a multiline description. It can span multiple lines. Useful for detailed documentation. '''
Normalization (same as Nameable):
obj.description = " Text " print(obj.description) # 'Text' obj.description = "" print(obj.description) # None
Long descriptions:
obj.description = "A" * 10000 # No length limit print(len(obj.description)) # 10000
- __init__(*args, **kwargs)#
Methods
__delattr__(name, /)Implement delattr(self, name).
__dir__(/)Default dir() implementation.
__eq__(value, /)Return self==value.
__format__(format_spec, /)Default object formatter.
__ge__(value, /)Return self>=value.
__getattribute__(name, /)Return getattr(self, name).
__getstate__(/)Helper for pickle.
__gt__(value, /)Return self>value.
__hash__(/)Return hash(self).
__init__(*args, **kwargs)__init_subclass__This method is called when a class is subclassed.
__le__(value, /)Return self<=value.
__lt__(value, /)Return self<value.
__ne__(value, /)Return self!=value.
__reduce__(/)Helper for pickle.
__reduce_ex__(protocol, /)Helper for pickle.
__repr__(/)Return repr(self).
__sizeof__(/)Size of object in memory, in bytes.
__str__(/)Return str(self).
__subclasshook__Abstract classes can override this to customize issubclass().
Attributes
__annotations__Free-form descriptive text.