Skip to content

PyoItemsView

Bases: ItemsView[K, V], PyoMappingView[tuple[K, V]], PyoSet[tuple[K, V]]


              flowchart TD
              pyochain._views.PyoItemsView[PyoItemsView]
              pyochain.abc._mappings.PyoMappingView[PyoMappingView]
              pyochain.abc._set.PyoSet[PyoSet]
              pyochain.abc._collection.PyoCollection[PyoCollection]
              pyochain.abc._iterable.PyoIterable[PyoIterable]
              pyochain.rs.Pipeable[Pipeable]
              pyochain.rs.Into[Into]
              pyochain.rs.Inspect[Inspect]
              pyochain.rs.Checkable[Checkable]
              pyochain.abc._collection.PyoContainer[PyoContainer]
              pyochain.abc._collection.PyoSized[PyoSized]

                              pyochain.abc._mappings.PyoMappingView --> pyochain._views.PyoItemsView
                                pyochain.abc._collection.PyoCollection --> pyochain.abc._mappings.PyoMappingView
                                pyochain.abc._iterable.PyoIterable --> pyochain.abc._collection.PyoCollection
                                pyochain.rs.Pipeable --> pyochain.abc._iterable.PyoIterable
                                pyochain.rs.Into --> pyochain.rs.Pipeable
                
                pyochain.rs.Inspect --> pyochain.rs.Pipeable
                

                pyochain.rs.Checkable --> pyochain.abc._iterable.PyoIterable
                

                pyochain.abc._collection.PyoContainer --> pyochain.abc._collection.PyoCollection
                
                pyochain.abc._collection.PyoSized --> pyochain.abc._collection.PyoCollection
                


                pyochain.abc._set.PyoSet --> pyochain._views.PyoItemsView
                                pyochain.abc._collection.PyoCollection --> pyochain.abc._set.PyoSet
                                pyochain.abc._iterable.PyoIterable --> pyochain.abc._collection.PyoCollection
                                pyochain.rs.Pipeable --> pyochain.abc._iterable.PyoIterable
                                pyochain.rs.Into --> pyochain.rs.Pipeable
                
                pyochain.rs.Inspect --> pyochain.rs.Pipeable
                

                pyochain.rs.Checkable --> pyochain.abc._iterable.PyoIterable
                

                pyochain.abc._collection.PyoContainer --> pyochain.abc._collection.PyoCollection
                
                pyochain.abc._collection.PyoSized --> pyochain.abc._collection.PyoCollection
                




              click pyochain._views.PyoItemsView href "" "pyochain._views.PyoItemsView"
              click pyochain.abc._mappings.PyoMappingView href "" "pyochain.abc._mappings.PyoMappingView"
              click pyochain.abc._set.PyoSet href "" "pyochain.abc._set.PyoSet"
              click pyochain.abc._collection.PyoCollection href "" "pyochain.abc._collection.PyoCollection"
              click pyochain.abc._iterable.PyoIterable href "" "pyochain.abc._iterable.PyoIterable"
              click pyochain.rs.Pipeable href "" "pyochain.rs.Pipeable"
              click pyochain.rs.Into href "" "pyochain.rs.Into"
              click pyochain.rs.Inspect href "" "pyochain.rs.Inspect"
              click pyochain.rs.Checkable href "" "pyochain.rs.Checkable"
              click pyochain.abc._collection.PyoContainer href "" "pyochain.abc._collection.PyoContainer"
              click pyochain.abc._collection.PyoSized href "" "pyochain.abc._collection.PyoSized"
            

A view of the items (key-value pairs) in a pyochain mapping.

Items are represented as tuples of (key, value) pairs, and the view supports set-like operations.

See Also

PyoMapping::items: Method that returns this view.

Source code in src/pyochain/_views.py
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
class PyoItemsView[K, V](  # pyright: ignore[reportUnsafeMultipleInheritance]
    ItemsView[K, V], PyoMappingView[tuple[K, V]], PyoSet[tuple[K, V]]
):
    """A view of the items (key-value pairs) in a pyochain mapping.

    Items are represented as tuples of `(key, value)` pairs, and the view supports set-like operations.

    See Also:
        `PyoMapping::items`: Method that returns this view.
    """

    # pyrefly: ignore [implicit-any-attribute]
    __slots__ = ()  # pyright: ignore[reportUnannotatedClassAttribute, reportIncompatibleUnannotatedOverride]

    @override
    def intersection(self, other: AbstractSet[tuple[K, V]]) -> SetMut[tuple[K, V]]:
        return SetMut.from_ref(self & other)

    @override
    def union(self, other: AbstractSet[tuple[K, V]]) -> SetMut[tuple[K, V]]:
        return SetMut.from_ref(self | other)

    @override
    def difference(self, other: AbstractSet[tuple[K, V]]) -> SetMut[tuple[K, V]]:
        return SetMut.from_ref(self - other)

    @override
    def symmetric_difference(
        self, other: AbstractSet[tuple[K, V]]
    ) -> SetMut[tuple[K, V]]:
        return SetMut.from_ref(self ^ other)