Re: Manipulating sets from the 2.4 C API?

2006-04-11 Thread Raymond Hettinger
Dave Opstad wrote: > I just looked through the Python/C API reference for 2.4.3 and didn't > see anything about using sets. I'd been expecting things like PySet_New, > PySet_Check etc. In Py2.4, there was not a custom set C API because the module was still ungoing significant development. For 2.4

Re: Manipulating sets from the 2.4 C API?

2006-04-11 Thread Felipe Almeida Lessa
Em Ter, 2006-04-11 às 18:55 +0200, "Martin v. Löwis" escreveu: > Dave Opstad wrote: > > If I want to handle sets should I just use a dictionary's keys and > > ignore the values, or is there some more explicit set support somewhere > > I'm not seeing? > > Indeed, there is. To create a new set, do

Re: Manipulating sets from the 2.4 C API?

2006-04-11 Thread Martin v. Löwis
Dave Opstad wrote: > If I want to handle sets should I just use a dictionary's keys and > ignore the values, or is there some more explicit set support somewhere > I'm not seeing? Indeed, there is. To create a new set, do PyObject_Call(PySet_Type, ""); To, say, invoke the add method, do

Re: Manipulating sets from the 2.4 C API?

2006-04-11 Thread Jack Diederich
On Tue, Apr 11, 2006 at 09:29:10AM -0700, Dave Opstad wrote: > I just looked through the Python/C API reference for 2.4.3 and didn't > see anything about using sets. I'd been expecting things like PySet_New, > PySet_Check etc. There is a public C API starting in 2.5, the progression for sets was

Manipulating sets from the 2.4 C API?

2006-04-11 Thread Dave Opstad
I just looked through the Python/C API reference for 2.4.3 and didn't see anything about using sets. I'd been expecting things like PySet_New, PySet_Check etc. If I want to handle sets should I just use a dictionary's keys and ignore the values, or is there some more explicit set support somewh