Negative array indicies and slice()

Chris Angelico rosuav at gmail.com
Thu Nov 1 14:53:54 EDT 2012


On Thu, Nov 1, 2012 at 10:32 PM, Andrew Robinson
<andrew3 at r3dsolutions.com> wrote:
> presently slice() allows memory leaks through GC loops.

Forgive me if I've missed something here, but isn't it only possible
to make a refloop by decidedly abnormal behaviour? Stuff like:

a=[]; a.append(slice(a))

Seriously, who does this? First you have to have a reference to a
container in place of an index, and then you have to retain the slice
object inside that same container as well. Neither operation is normal
use of a slice. Where is the problem?

ChrisA



More information about the Python-list mailing list