Re: memory recycling/garbage collecting problem

2009-02-26 Thread David Niergarth
On Feb 16, 11:21 pm, Yuanxin Xi wrote: > Could anyone please explain why this happens?  It seems some memory > are not freed. There is a "bug" in versions of Python prior to 2.5 where memory really isn't released back to the OS. Python 2.5 contains a new object allocator that is able to return me

Re: memory recycling/garbage collecting problem

2009-02-26 Thread David Niergarth
Tim Peters showed a way to demonstrate the fix in http://mail.python.org/pipermail/python-dev/2006-March/061991.html > For simpler fun, run this silly little program, and look at memory > consumption at the prompts: > > """ > x = [] > for i in xrange(100): >x.append([]) > raw_input("full

Re: default behavior

2010-08-12 Thread David Niergarth
Peter Otten <__pete...@web.de> wrote: > > >>> 1 .conjugate() > This is a syntax I never noticed before. My built-in complier (eyes) took one look and said: "that doesn't work." Has this always worked in Python but I never noticed? I see other instance examples also work. >>> '1' .zfill(2) '01

Re: default behavior

2010-08-12 Thread David Niergarth
[Oops, now complete...] Peter Otten <__pete...@web.de> wrote: > > > >>> 1 .conjugate() > This is a syntax I never noticed before. My built-in complier (eyes) took one look and said: "that doesn't work." Has this always worked in Python but I never noticed? I see other instance examples also work.

Re: Clarity vs. code reuse/generality

2009-07-06 Thread David Niergarth
I remember in college taking an intro programming class (C++) where the professor started us off writing a program to factor polynomials; he probably also incorporated binary search into an assignment. But people don't generally use Python to implement binary search or factor polynomials so maybe y