[EMAIL PROTECTED] wrote:
> Klaas:
>
> > Well, you can reduce the memory usage to virtually nothing by using a
> > generator expression rather than list comprehension.
>
> Are you sure? I don't think so. Can you show a little example?
Sorry, that was boneheaded and wrong.
-Mike
--
http://mail.py
Thank you for the answers Terry Reedy and Klaas.
> Since you are writing extensions, you can create a built-in subclass of
> dict to experiment with. I presume the 2.5 default dict should be a model.
That way it's doable, but I think it's of limited use too; I'd like to
remove elements from arbi
[EMAIL PROTECTED] wrote:
> I have started doing practice creating C extensions for CPython, so
> here are two ideas I have had, possibly useless.
>
> If you keep adding elements to a CPython dict/set, it periodically
> rebuilds itself. So maybe dict.reserve(n) and a set.reserve(n) methods
> may hel
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> If you keep adding elements to a CPython dict/set, it periodically
> rebuilds itself. So maybe dict.reserve(n) and a set.reserve(n) methods
> may help, reserving enough (empty) memory for about n *distinct* keys
> the programmer wants
I have started doing practice creating C extensions for CPython, so
here are two ideas I have had, possibly useless.
If you keep adding elements to a CPython dict/set, it periodically
rebuilds itself. So maybe dict.reserve(n) and a set.reserve(n) methods
may help, reserving enough (empty) memory f