On Tue, Feb 21, 2012 at 11:21 AM, Carl Friedrich Bolz <[email protected]> wrote:

> On 02/20/2012 06:50 PM, Alex Gaynor wrote:
> > Unfortunately this commit has some bad effects.  Going through an
> > iterator in popitem() will result in O(N**2) behavior for repeated
> > calls.  If you look at the r_dict implementation of popitem() you can
> > see the fix there.
>
> This is just the default implementation for the DictStrategy base class.
> All interesting subclasses override this default. The segfault happened
> because the dict proxy strategy doesn't override it.
>
> So yes, calling A.__dict__.popitem repeatedly for a class A is O(N**2). Do
> we care?
>
> Cheers,
>
> Carl Friedrich
> ______________________________**_________________
> pypy-dev mailing list
> [email protected]
> http://mail.python.org/**mailman/listinfo/pypy-dev<http://mail.python.org/mailman/listinfo/pypy-dev>
>

No, anyone doing that deserves what they get ;)  Sorry I missed that the
subclass overrode it.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
_______________________________________________
pypy-dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to