Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #15750
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!multikabel.net!newsfeed20.multikabel.net!amsnews11.chello.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'cpython': 0.05; 'names.': 0.07; 'removes': 0.07; 'python': 0.08; '"a"': 0.09; 'ironpython': 0.09; 'subject:Extracting': 0.09; 'am,': 0.12; '16,': 0.15; 'language,': 0.15; 'this:': 0.15; '"del"': 0.16; '(assuming': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'initially,': 0.16; 'jython': 0.16; 'none"': 0.16; 'object).': 0.16; 'objects;': 0.16; 'wed,': 0.17; 'wrote:': 0.18; 'exists': 0.18; 'received:209.85.210.174': 0.18; 'received:mail- iy0-f174.google.com': 0.18; '(which': 0.19; 'trying': 0.21; "aren't": 0.21; 'maybe': 0.21; 'least,': 0.23; 'header:In-Reply- To:1': 0.23; 'there.': 0.24; "python's": 0.24; 'statement': 0.25; "i'm": 0.26; 'fact': 0.27; 'not.': 0.27; 'language.': 0.28; 'effect': 0.28; 'right.': 0.28; 'bound': 0.28; 'explicitly': 0.28; 'message-id:@mail.gmail.com': 0.29; 'behaves': 0.30; 'object.': 0.30; 'equivalent': 0.30; 'subject:?': 0.31; 'nov': 0.31; 'regardless': 0.31; 'objects': 0.32; 'does': 0.32; "isn't": 0.32; 'to:addr:python-list': 0.32; 'actually': 0.33; 'that,': 0.33; 'identical': 0.34; 'languages': 0.34; 'object': 0.35; 'connection': 0.36; 'explain': 0.36; 'subject:lists': 0.36; 'none': 0.36; 'but': 0.37; 'steven': 0.38; 'received:google.com': 0.38; 'some': 0.38; 'received:209.85': 0.38; "it's": 0.39; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; 'release': 0.40; 'delete': 0.40; 'far': 0.40; 'received:209': 0.40; '2011': 0.62; 'view': 0.65; 'here.': 0.66; 'roughly': 0.67; '"delete"': 0.84; 'subject:over': 0.84; 'spec': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=5EW7hsDRfa657JoZuq3WSb4jpx09NrmI2hf/vnbIb4E=; b=v6Pe0JXMcrlLqJ/Zioec2hicuYjgAvy/qV+wdThmPeZqipcNXgIaTcQxPaU+vY3vRv hpkBEz8mke2fv+d+0Y9nfVow5kl4B1SY8CP4e81PaSPOj5jaH63IPFl2cA0ZCcqe0Xts D4MBl+v+KNYPfxgkaNt3CDTM8sJgv3DlwboSE= |
| MIME-Version | 1.0 |
| In-Reply-To | <4ec2e6cb$0$29970$c3e8da3$5496439d@news.astraweb.com> |
| References | <b9e53a75-7490-4b6a-844a-20cfce263939@a12g2000vbz.googlegroups.com> <j995eq$vr9$1@news.univ-fcomte.fr> <cf007146-3a08-44c4-bf01-d1a9253c83e3@o19g2000vbk.googlegroups.com> <4EB828B3.1020509@sequans.com> <5B80DD153D7D744689F57F4FB69AF4740182FE@SCACMX008.exchad.jpmchase.net> <4EC2ACCC.2000100@davea.name> <mailman.2745.1321386809.27778.python-list@python.org> <4ec2e6cb$0$29970$c3e8da3$5496439d@news.astraweb.com> |
| Date | Wed, 16 Nov 2011 09:54:15 +1100 |
| Subject | Re: Extracting elements over multiple lists? |
| From | Chris Angelico <rosuav@gmail.com> |
| To | python-list@python.org |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | quoted-printable |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2756.1321397658.27778.python-list@python.org> (permalink) |
| Lines | 44 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1321397658 news.xs4all.nl 6892 [2001:888:2000:d::a6]:50736 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:15750 |
Show key headers only | View raw
On Wed, Nov 16, 2011 at 9:25 AM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> Languages aren't refcounted. Or at least, *Python* isn't a refcounted
> language. CPython is a refcounted implementation. IronPython and Jython
> are not. del behaves exactly the same in IronPython and Jython as it does
> in CPython: it removes the name, which may have a side-effect of deleting
> the object.
Yes, I was sloppy there. A non-manually-memory-managed language, if
you will; it's part of Python's spec that you do NOT have to
explicitly release objects you're no longer using.
>> The del
>> statement is identical to "a = None" in terms of deleting objects;
>
> I'm not entirely sure what you arr trying to say here. I *think* you are
> trying to say is this:
>
> Given that `a` is bound to my_object initially, `del a`
> from the point of view of my_object is no different
> from re-binding a to some other object such as None
> (or any other object).
>
> which is true as far as it goes, but it fails to note that the name "a"
> no longer exists after `del a` while it does exist after `a = None`.
Right. Both actions have the same effect wrt deleting my_object; the
only connection between Python's "del" and C++'s "delete" is that,
which del shares with "a = None".
The fact is that, regardless of the Python implementation, deleting
*objects* is not the programmer's responsibility. The only thing he
can or must do is delete *names*.
del a
del globals()['a']
globals().__delitem__('a')
are all roughly equivalent (assuming that a is global). Maybe this is
the best way to explain it - that you're deleting from a "dictionary"
(which may or may not actually be implemented as a dict) of local
names.
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Extracting elements over multiple lists? JoeM <josephmeiring@gmail.com> - 2011-11-07 09:12 -0800
Re: Extracting elements over multiple lists? John Gordon <gordon@panix.com> - 2011-11-07 17:37 +0000
Re: Extracting elements over multiple lists? Laurent Claessens <moky.math@gmail.com> - 2011-11-07 18:44 +0100
Re: Extracting elements over multiple lists? JoeM <josephmeiring@gmail.com> - 2011-11-07 10:01 -0800
Re: Extracting elements over multiple lists? John Gordon <gordon@panix.com> - 2011-11-07 18:22 +0000
Re: Extracting elements over multiple lists? Terry Reedy <tjreedy@udel.edu> - 2011-11-07 19:06 -0500
Re: Extracting elements over multiple lists? Peter Otten <__peter__@web.de> - 2011-11-07 19:33 +0100
Re: Extracting elements over multiple lists? Jean-Michel Pichavant <jeanmichel@sequans.com> - 2011-11-07 19:51 +0100
Re: Extracting elements over multiple lists? Dave Angel <d@davea.name> - 2011-11-07 15:06 -0500
Re: Extracting elements over multiple lists? Laurent Claessens <moky.math@gmail.com> - 2011-11-08 08:07 +0100
RE: Extracting elements over multiple lists? "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2011-11-15 17:01 +0000
Re: Extracting elements over multiple lists? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-11-15 22:21 +0000
Re: Extracting elements over multiple lists? Dave Angel <d@davea.name> - 2011-11-15 13:17 -0500
Re: Extracting elements over multiple lists? Chris Angelico <rosuav@gmail.com> - 2011-11-16 06:53 +1100
Re: Extracting elements over multiple lists? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-11-15 22:25 +0000
Re: Extracting elements over multiple lists? Chris Angelico <rosuav@gmail.com> - 2011-11-16 09:54 +1100
Re: Extracting elements over multiple lists? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-11-07 19:06 +0100
csiph-web