Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #89806
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!ecngs!feeder2.ecngs.de!217.188.199.168.MISMATCH!takemy.news.telefonica.de!storethat.news.telefonica.de!telefonica.de!news.panservice.it!feed.xsnews.nl!border01.ams.xsnews.nl!feeder01.ams.xsnews.nl!abp001.ams.xsnews.nl!frontend-F10-10.ams.news.kpn.nl |
|---|---|
| From | Cecil Westerhof <Cecil@decebal.nl> |
| Newsgroups | comp.lang.python |
| Subject | Re: Inner workings of this Python feature: Can a Python data structure reference itself? |
| Organization | Decebal Computing |
| References | <387ac520-9da3-411a-a3b8-b326e1e8a2c0@googlegroups.com> <mailman.26.1430597813.12865.python-list@python.org> |
| X-Face | "(y8cC@tg_12{">GF'UXTW]FHI2wMiZNrnf'1EFQ&O#$m:f#O7+7}kR<J%a^F2lh4[N~Yz4 nSp#c+aQo1b5=?HcNEkQ7QzF<])O3X4MDL/AYjys&*mt>,v+Pti8=Vi/Z"g^?b"E |
| X-Homepage | http://www.decebal.nl/ |
| Date | Sat, 02 May 2015 23:06:38 +0200 |
| Message-ID | <87a8xmn0yp.fsf@Equus.decebal.nl> (permalink) |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
| Cancel-Lock | sha1:dd9VJgBHk5tw+uEdfWiTX+mbeGU= |
| MIME-Version | 1.0 |
| Content-Type | text/plain |
| Lines | 41 |
| NNTP-Posting-Host | 81.207.62.244 |
| X-Trace | 1430602130 news.kpn.nl 21092 81.207.62.244@kpn/81.207.62.244:41941 |
| Xref | csiph.com comp.lang.python:89806 |
Show key headers only | View raw
Op Saturday 2 May 2015 22:17 CEST schreef Tim Chase: > [dangit, had Control down when I hit <enter> and it sent > prematurely] > > On 2015-05-02 13:02, vasudevram wrote: >> http://jugad2.blogspot.in/2015/05/can-python-data-structure-reference.html >> >> https://docs.python.org/2/reference/datamodel.html >> >> and saw this excerpt: >> >> [ CPython implementation detail: CPython currently uses a >> reference-counting scheme with (optional) delayed >> detection of cyclically linked garbage, which collects >> most objects as soon as they become unreachable, but is >> not guaranteed to collect garbage containing circular >> references. ] >> >> Not sure whether it is relevant to the topic at hand, >> since, on the one hand, it uses the words "cyclically >> linked", but on the other, it says "garbage collection". > > The gotcha happens in a case where you do something like this: > > lst = [] > lst.append(lst) # create a cycle > del lst > > This creates a cycle, then makes it unreachable, but the list is > still referenced by itself, so the reference count never drops to > zero (where it would get GC'd), and thus that item lingers around in > memory. Maybe look at Java? If my memory is correct, the JVM gc reclaims those kind of things also. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Inner workings of this Python feature: Can a Python data structure reference itself? vasudevram <vasudevram@gmail.com> - 2015-05-02 13:02 -0700
Re: Inner workings of this Python feature: Can a Python data structure reference itself? Tim Chase <python.list@tim.thechases.com> - 2015-05-02 15:17 -0500
Re: Inner workings of this Python feature: Can a Python data structure reference itself? vasudevram <vasudevram@gmail.com> - 2015-05-02 14:07 -0700
Re: Inner workings of this Python feature: Can a Python data structure reference itself? Cecil Westerhof <Cecil@decebal.nl> - 2015-05-02 23:06 +0200
Re: Inner workings of this Python feature: Can a Python data structure reference itself? MRAB <python@mrabarnett.plus.com> - 2015-05-03 00:07 +0100
Re: Inner workings of this Python feature: Can a Python data structure reference itself? Tim Chase <python.list@tim.thechases.com> - 2015-05-02 20:57 -0500
Re: Inner workings of this Python feature: Can a Python data structure reference itself? Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-02 22:29 -0600
Re: Inner workings of this Python feature: Can a Python data structure reference itself? Tim Chase <python.list@tim.thechases.com> - 2015-05-02 15:10 -0500
Re: Inner workings of this Python feature: Can a Python data structure reference itself? Terry Reedy <tjreedy@udel.edu> - 2015-05-02 19:17 -0400
Re: Inner workings of this Python feature: Can a Python data structure reference itself? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-03 21:10 +1000
Re: Inner workings of this Python feature: Can a Python data structure reference itself? vasudevram <vasudevram@gmail.com> - 2015-05-03 05:59 -0700
Re: Inner workings of this Python feature: Can a Python data structure reference itself? vasudevram <vasudevram@gmail.com> - 2015-05-03 06:05 -0700
Re: Inner workings of this Python feature: Can a Python data structure reference itself? Chris Angelico <rosuav@gmail.com> - 2015-05-03 23:08 +1000
Re: Inner workings of this Python feature: Can a Python data structure reference itself? vasudevram <vasudevram@gmail.com> - 2015-05-03 08:46 -0700
Re: Inner workings of this Python feature: Can a Python data structure reference itself? Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-02 22:43 -0600
Re: Inner workings of this Python feature: Can a Python data structure reference itself? Chris Angelico <rosuav@gmail.com> - 2015-05-03 15:46 +1000
Re: Inner workings of this Python feature: Can a Python data structure reference itself? vasudevram <vasudevram@gmail.com> - 2015-05-03 03:52 -0700
csiph-web