picop.protocols#
Category facade: abstract Protocols (mapping / sequence / number / object).
Provisional after 1.0 — not part of the Core freeze. Prefer picop.containers /
picop.hot when you know dict / list / tuple / …. Use this facade only
when the concrete type is unknown. May still evolve under post-1.0 minors.
- picop.protocols.map_check(o)#
Return True if
oprovides the mapping protocol.
- picop.protocols.map_eq(a, b)#
Return True if mappings are equal via identity/size short-circuit + richcompare.
Notes
Prefer
dict_eqwhen both operands are knowndictinstances.
- picop.protocols.map_has_key(o, key)#
Return True if mapping
ohaskey.
- picop.protocols.seq_check(o)#
Return True if
osupports the sequence protocol (PySequence_Check).
- picop.protocols.seq_eq(a, b)#
Return True if sequences are equal via identity/size short-circuit + richcompare.
Notes
Prefer
list_eq/tuple_eqwhen both operands are typed.
- picop.protocols.seq_get(o, i)#
Return
o[i]viaPySequence_GetItem.
- picop.protocols.seq_contains(o, value)#
Return
value in oviaPySequence_Contains.
- picop.protocols.num_check(o)#
Return True if
oprovides the number protocol (PyNumber_Check).
- picop.protocols.num_eq(a, b)#
Return True if
a == bvia richcompare (abstract number; NaN parity).