lenskit.data.repr#

Utility functions for implementing __str__ and __repr__ methods with consistent syntax.

Classes#

HasObjectRepr

Base class for protocol classes.

ReprWriter

ReprIndenter

ObjectRepr

Functions#

object_repr(tag, *words[, comment])

Construct string "object" representations.

Module Contents#

lenskit.data.repr.object_repr(tag, *words, comment=None, **attrs)#

Construct string “object” representations.

Parameters:
  • tag (str)

  • words (str)

  • comment (str | None)

  • attrs (Any)

Return type:

ObjectRepr