Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix support of sequence protocol for returned lists
Add the `sequence` option to PyO3's `pyclass`, so that the `sq_length` slot is implemented [1]. Implementing this method is required for sequence types, or Python C API functions like `PySequence_Size` will fail with an error. The `reversed` built-in method relies on `PySequence_*` methods. A test reversing `NodeIndices` is added to guard against future violations of the sequence protocol. Fixes Qiskit#696. [1]: PyO3/pyo3#2567
- Loading branch information