Open
Description
- Object protocol
- https://docs.python.org/3/c-api/object.html
- This protocol will not be a type or trait.
impl PyObjectRef
invm/src/protocol/object.rs
will be enuogh - Py_RETURN_NOTIMPLEMENTED (PyArithmeticValue::NotImplemented)
- PyObject_Print
- PyObject_HasAttr / PyObject_HasAttrString (has_attr)
- PyObject_GetAttr / PyObject_GetAttrString (get_attr)
- PyObject_GenericGetAttr
- PyObject_SetAttr / PyObject_SetAttrString (set_attr)
- PyObject_GenericSetAttr
- PyObject_DelAttr / PyObject_DelAttrString (del_attr)
- PyObject_GenericGetDict
- PyObject_GenericSetDict
- PyObject_RichCompare (rich_compare)
- PyObject_RichCompareBool (rich_compare_bool)
- PyObject_Repr (repr)
- PyObject_ASCII (ascii)
- PyObject_Str (str)
- PyObject_Bytes (bytes)
- PyObject_IsSubclass (is_subclass)
- PyObject_IsInstance (is_instance)
- PyObject_Hash (hash)
- PyObject_HashNotImplemented Update to pass test for unhashable collections #4640
- PyObject_IsTrue (is_true)
- PyObject_Not (not)
- PyObject_Type implement PyObject_Type and PyObject_TypeCheck #5091
- PyObject_TypeCheck implement PyObject_Type and PyObject_TypeCheck #5091
- PyObject_Size / PyObject_Length (length)
- PyObject_LengthHint (length_hint)
- PyObject_GetItem (get_item)
- PyObject_SetItem (set_item)
- PyObject_DelItem (del_item)
- PyObject_Dir
- PyObject_GetIter (get_iter)
- PyObject_GetAIter implement PyObject_GetAIter for PyObject #5090
- Call protocol
- https://docs.python.org/3/c-api/call.html
-
Callable
trait to provide type slotcall
. -
PyCallable
protocol object to provide interface (at least check) Add protocol object PyCallable #4654 - Vectercall protocol
- Number protocol
- https://docs.python.org/3/c-api/number.html
- Design decision where to put PyNumber_* functions
- Apply to actual operations Improve: binaryops with number protocol #4139
-
AsNumber
trait to provide type slotas_number
. Implement Number Protocol #3507- None Implement Number protocol for PyNone #3880
- bool Implement Number Protocol for
PyBool
#4639 - bytearray Implement Number Protocol for
PyByteArray
#4574 - bytes Implement number protocol for
PyBytes
#3903 - complex Implement Number protocol for PyComplex #3838
- dict Implement Number Protocol for
PyDict
#4644 - dictviews
- float Implement Number Protocol #3507
- int Implement Number Protocol #3507
- range
- set Implement Number Protocol for
PyType
,PySet
andPyFrozenSet
#4619 - frozenset Implement Number Protocol for
PyType
,PySet
andPyFrozenSet
#4619 - type Implement Number Protocol for
PyType
,PySet
andPyFrozenSet
#4619 - str — Add number protocol for PyStr #4622
- weakref
- mappingproxy Implement missing methods to
MappingProxy
#3898 - decimal
- collections.deque
- collections.defaultdict
- collections.OrderedDict
- time.timedelta
- time.date
- time.datetime
- matmul
- ctypes CFuncPtr, Simple, Pointer
- PyHKEY
-
PyIndex_Check
-
PyNumber
Implement Number Protocol #3507
- Sequence protocol
- https://docs.python.org/3/c-api/sequence.html
-
AsSequence
trait to provide type slotas_sequence
. Impl PySequence Protocol #3316- array Implement
as_sequence
forarray
#4585 - bytesarray
- bytes
- mappingproxy
- dict
- dictkeys
- dictitems
- dictvalues
- list
- memory
- range
- set
- frozenset
- tuple
- str
- weakref proxy
- collections.deque
- ctypes.CDataType, Array, Pointer
- xml.etree.ElementTree.Element
- array Implement
-
PySequence
type or trait to support sequence features. Impl PySequence Protocol #3316 Refactor and new sequence traits, generic sequence operation #3445- Note: Check
SimpleSeq
before working on it.
- Note: Check
- Mapping protocol
- https://docs.python.org/3/c-api/mapping.html
-
Mapping
trait to provide type slotas_mapping
- array, bytearray, bytes, dict, list, mappingproxy, memoryview, range, tuple done
- str Implement
AsMapping
forPyStr
#3417 - OrderedDict
- weakref proxy/callable proxy
- DecSignalDict
- GenericAlias Implement
mapping
trait forGenericAlias
#3374 - ctypes Array/Pointer
- xml.etree.ElementTree.Element
-
PyMapping
type to provide its methods
- Iterator protocol
- https://docs.python.org/3/c-api/iter.html
-
Iterator
protocol for type slotiternext
- Check the list of types
- PyIter type
- PyIter_Check
- PyIter_Next
- PyAIter_Check
- PyIter_Send
- Buffer protocol
- https://docs.python.org/3/c-api/buffer.html
-
AsBuffer
protocol for type slotas_buffer
Implement Buffer Protocol #2226- bytearray
- bytes
- memory
- ctypes.CData
-
PyBuffer
type - Check if we need Old buffer protocol compatibiiltiy layer