wrap¶
- class pythonic_fp.gadgets.wrap.Wrap(item: T)¶
Immutablely wrap exactly one value of a given type.
Tip
Wrapobjects can be used in Python match statements.- __init__(item: T) None¶
- __repr__() str¶
Return repr(self).
- __eq__(other: object) bool¶
Efficiently compare to another object.
- Parameters:
other – The object to be compared with,
- Returns:
Trueifotheris of type Wrap and wraps an object which compares as equal to the wrapped object, otherwiseFalse.
- class pythonic_fp.gadgets.wrap.HWrap(item: T)¶
Immutablely wrap exactly one hashable value of a given type.
Tip
HWrapobjects can be used in Python match statements.Tip
HWrapobjects are hashable..- __init__(item: T) None¶
- __hash__() int¶
Return hash(self).
- __repr__() str¶
Return repr(self).
- __eq__(other: object) bool¶
Efficiently compare to another object.
- Parameters:
other – The object to be compared with,
- Returns:
Trueifotheris of type HWrap and wraps an object which compares as equal to the wrapped object, otherwiseFalse.