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 o provides the mapping protocol.

Parameters:

o (object)

Return type:

bool

picop.protocols.map_eq(a, b)#

Return True if mappings are equal via identity/size short-circuit + richcompare.

Notes

Prefer dict_eq when both operands are known dict instances.

Parameters:
Return type:

bool

picop.protocols.map_has_key(o, key)#

Return True if mapping o has key.

Parameters:
Return type:

bool

picop.protocols.seq_check(o)#

Return True if o supports the sequence protocol (PySequence_Check).

Parameters:

o (object)

Return type:

bool

picop.protocols.seq_eq(a, b)#

Return True if sequences are equal via identity/size short-circuit + richcompare.

Notes

Prefer list_eq / tuple_eq when both operands are typed.

Parameters:
Return type:

bool

picop.protocols.seq_get(o, i)#

Return o[i] via PySequence_GetItem.

Parameters:
Return type:

object

picop.protocols.seq_contains(o, value)#

Return value in o via PySequence_Contains.

Parameters:
Return type:

bool

picop.protocols.num_check(o)#

Return True if o provides the number protocol (PyNumber_Check).

Parameters:

o (object)

Return type:

bool

picop.protocols.num_eq(a, b)#

Return True if a == b via richcompare (abstract number; NaN parity).

Parameters:
Return type:

bool

picop.protocols.obj_eq(a, b)#

Return True if a == b via PyObject_RichCompareBool.

Notes

Identity short-circuit applies. Prefer typed *_eq when both operands have a known Core type.

Parameters:
Return type:

bool