{ } Raw JSON

bundles / papyri latest / papyri / examples / Patti

class

papyri.examples:Patti

source: /papyri/examples.py :712

Signature

class   Patti ( name : str items : list[int] | None = None )  →  None

Members

Summary

Small class used to demonstrate cross-linked method docstrings.

Extended Summary

Patti exposes an initialiser, an instance method, a generator method, an async generator method, a classmethod and a staticmethod. Method docstrings reference free functions such as simple_generator and async_fetch so the viewer can exercise :meth::func: cross-links in both directions.

Parameters

name : str

Display name.

items : list of int, optional

Payload values. Defaults to an empty list.

Attributes

name : str

The value passed at construction.

items : list of int

The stored payload.

Examples

p = Patti("demo", items=[1, 2, 3])
p.total()

See also

higher_order

Standalone function taking a ~collections.abc.Callable.

simple_generator

Standalone generator.

Aliases

  • papyri.examples.Patti