Issue7321
Created on 2009-11-14 09:08 by damianeads, last changed 2022-04-11 14:56 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg95229 - (view) | Author: Damian Eads (damianeads) | Date: 2009-11-14 09:08 | |
The instructions for the C interface to the Python set class http://docs.python.org/c-api/set.html say to use PyObject_GetIter and follow the iterator protocol. After following the instructions for the iterator protocol here, http://docs.python.org/c-api/iter.html I was able to successfully iterate through a set object. However, PyIter_Check(obj) returns false yet set objects follow the iterator protocol. Is this the correct behavior? Thank you. Kind regards, Damian Eads |
|||
| msg95240 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2009-11-14 13:42 | |
Set objects are iterable, they are not iterators themselves. In other words, PyIter_Check() should return true when called with the result of PyObject_GetIter() (but normally you don't need to check anyway). |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:56:54 | admin | set | github: 51570 |
| 2009-11-14 13:42:33 | pitrou | set | status: open -> closed nosy:
+ pitrou resolution: not a bug |
| 2009-11-14 09:08:46 | damianeads | create | |
