Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #98815

Re: Persist objects in a LIST

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Vincent Vande Vyvre <vincent.vande.vyvre@telenet.be>
Newsgroups comp.lang.python
Subject Re: Persist objects in a LIST
Date Sat, 14 Nov 2015 17:33:59 +0100
Lines 30
Message-ID <mailman.331.1447519455.16136.python-list@python.org> (permalink)
References <0cb1bcda-54d5-4cc7-bd23-f86f7f10ee28@googlegroups.com> <15f9fdeb-f4b4-4404-bccb-2e67a26035ed@googlegroups.com> <sale4b1mf366fhioarhastvbksjf0c9hfb@4ax.com>
Reply-To vincent.vandevyvre@oqapy.eu
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 8bit
X-Trace news.uni-berlin.de x2GC5qBEJlBqgD0EGYmFygy5jtmyAt5aO+m5PYpoCXwQ==
Return-Path <vincent.vande.vyvre@telenet.be>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.048
X-Spam-Evidence '*H*': 0.91; '*S*': 0.00; 'empty,': 0.09; 'from:name:vincent vande vyvre': 0.16; 'received:195.130': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'received:telenet- ops.be': 0.16; '\xe9crit': 0.16; 'solution.': 0.18; '>>>': 0.20; '2015': 0.20; 'rid': 0.22; 'sat,': 0.23; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'dictionary': 0.29; 'second,': 0.29; 'creating': 0.30; 'received:be': 0.30; 'nov': 0.35; 'replace': 0.35; 'should': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'to:addr:python.org': 0.40; 'john': 0.61; 'charset:windows-1252': 0.62; 'binding': 0.66; 'header:Reply- To:1': 0.67; 'reply-to:no real name:2**0': 0.71; 'dennis': 0.91
User-Agent Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
In-Reply-To <sale4b1mf366fhioarhastvbksjf0c9hfb@4ax.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:98815

Show key headers only | View raw


Le 14/11/2015 16:39, Dennis Lee Bieber a écrit :
> On Sat, 14 Nov 2015 07:02:41 -0800 (PST), John Zhao <johnzzhao@gmail.com>
> declaimed the following:
>
>> I found a solution.  replace  bDict.clear() with  bDict = {}
>>
> 	Which is creating a second, empty, dictionary and binding the name
> "bDict" to that new one.
>
> 	If all you want is to get rid of the name
>
> 		del bDict
>
> should suffice.
Not exactly.

 >>> l = []
 >>> d = {'key': 'val'}
 >>> l.append(d)
 >>> l
[{'key': 'val'}]
 >>> del d
 >>> l
[{'key': 'val'}]
 >>> del l[0]
 >>> l
[]
 >>>

Vince

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Persist objects in a  LIST John Zhao <johnzzhao@gmail.com> - 2015-11-14 06:26 -0800
  Re: Persist objects in a  LIST John Zhao <johnzzhao@gmail.com> - 2015-11-14 07:02 -0800
    Re: Persist objects in a  LIST Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-11-14 10:39 -0500
    Re: Persist objects in a LIST Vincent Vande Vyvre <vincent.vande.vyvre@telenet.be> - 2015-11-14 17:33 +0100

csiph-web