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. :type o:object:param o:
- 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. :type o:object:param o: :type key:object:param key:
- picop.protocols.seq_check(o)#
Return True if
osupports the sequence protocol (PySequence_Check). :type o:object:param o:
- 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. :type o:object:param o: :type i:int:param i:
- picop.protocols.seq_contains(o, value)#
Return
value in oviaPySequence_Contains. :type o:object:param o: :type value:object:param value:
- picop.protocols.num_check(o)#
Return True if
oprovides the number protocol (PyNumber_Check). :type o:object:param o: