- Notifications
You must be signed in to change notification settings - Fork1.3k
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_HashNotImplementedUpdate to pass test for unhashable collections #4640
- PyObject_IsTrue (is_true)
- PyObject_Not (not)
- PyObject_Typeimplement PyObject_Type and PyObject_TypeCheck #5091
- PyObject_TypeCheckimplement 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_GetAIterimplement 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 operationsImprove: binaryops with number protocol #4139
AsNumber
trait to provide type slotas_number
.Implement Number Protocol #3507- NoneImplement Number protocol for PyNone #3880
- boolImplement Number Protocol for
PyBool
#4639 - bytearrayImplement Number Protocol for
PyByteArray
#4574 - bytesImplement number protocol for
PyBytes
#3903 - complexImplement Number protocol for PyComplex #3838
- dictImplement Number Protocol for
PyDict
#4644 - dictviews
- floatImplement Number Protocol #3507
- intImplement Number Protocol #3507
- range
- setImplement Number Protocol for
PyType
,PySet
andPyFrozenSet
#4619 - frozensetImplement Number Protocol for
PyType
,PySet
andPyFrozenSet
#4619 - typeImplement Number Protocol for
PyType
,PySet
andPyFrozenSet
#4619 - str —Add number protocol for PyStr #4622
- weakref
- mappingproxyImplement 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- arrayImplement
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
- arrayImplement
PySequence
type or trait to support sequence features.Impl PySequence Protocol #3316Refactor 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
- strImplement
AsMapping
forPyStr
#3417 - OrderedDict
- weakref proxy/callable proxy
- DecSignalDict
- GenericAliasImplement
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