Re: New-style classes, iter and PySequence_Check

2005-04-14 Thread Raymond Hettinger
[Bengt Richter] > I'm not sure, but I think it may be expedient optimization practicality beating purity. It is more a matter of coping with the limitations of the legacy API where want to wrap a sequence iterator around __getitem__ in sequences but not in mappings. > > I haven't walked the r

Re: New-style classes, iter and PySequence_Check

2005-04-14 Thread Bengt Richter
On Thu, 14 Apr 2005 15:18:20 -0600, Steven Bethard <[EMAIL PROTECTED]> wrote: >Tuure Laurinolli wrote: >> Someone pasted the original version of the following code snippet on >> #python today. I started investigating why the new-style class didn't >> work as expected, and found that at least som

Re: New-style classes, iter and PySequence_Check

2005-04-14 Thread Raymond Hettinger
[Tuure Laurinolli] > Someone pasted the original version of the following code snippet on > #python today. I started investigating why the new-style class didn't > work as expected > classes apparently don't return true for PyInstance_Check, which causes > a problem in PySequence_Check, since it wi

Re: New-style classes, iter and PySequence_Check

2005-04-14 Thread Steven Bethard
Tuure Laurinolli wrote: Someone pasted the original version of the following code snippet on #python today. I started investigating why the new-style class didn't work as expected, and found that at least some instances of new-style classes apparently don't return true for PyInstance_Check, whic

New-style classes, iter and PySequence_Check

2005-04-14 Thread Tuure Laurinolli
Someone pasted the original version of the following code snippet on #python today. I started investigating why the new-style class didn't work as expected, and found that at least some instances of new-style classes apparently don't return true for PyInstance_Check, which causes a problem in P