WithMeta

class utilipy.utils.WithMeta(wrapped: Any, **kw)[source]

Bases: ObjectProxy

Objects wrapt to include metadata.

This is an ObjectProxy for thin and light wrappers.

  • Thin: All operations are carried to the wrapt value,

    except for self.meta, which accesses the meta attribute.

  • Light: operations do not carry the metadata

    >>> x = WithMeta(2)
    >>> y = x + 2
    >>> y.meta  
    AttributeError: 'int' object has no attribute 'meta'
    

Notes

see metadata for usage of the metadata module.

Attributes
metaMetaData

Metadata.

Object wrapt to include metadata.

Parameters
wrappedT.Any

WithMeta wraps anything, just adding metadata.

kwDict[T.Any, T.Any]

the key, value pairs for the metadata

Attributes Summary

meta

Metadata.

Attributes Documentation

meta

Metadata.