Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.023 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'sun,': 0.09; 'am,': 0.14; 'wrote:': 0.14; 'element,': 0.16; 'set,': 0.16; 'set;': 0.16; 'subject:Converting': 0.16; 'subject:set': 0.16; 'subject:list': 0.22; 'header:In-Reply-To:1': 0.22; 'itself.': 0.22; 'received:209.85.214.174': 0.23; 'received:mail- iw0-f174.google.com': 0.23; 'set.': 0.23; 'chris': 0.27; 'message- id:@mail.gmail.com': 0.28; 'probably': 0.30; 'list': 0.30; 'to:addr:python-list': 0.32; 'another': 0.32; 'creates': 0.33; 'reference': 0.34; 'change': 0.34; 'received:209.85': 0.37; 'received:google.com': 0.38; 'received:209.85.214': 0.39; 'set': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.39; "it's": 0.40; 'header:Received:5': 0.40; '2011': 0.62; '12:14': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=GbY7oL+jWu9RYVTnk5Wd4NEmES6YQPISfHzAquBL2KU=; b=rPzx3u7aAktguR+f5ZPnf5HGOE9l0EiEZk+0RcYWKXUJjU7KaRUvoxYe29I0n+ZiTt fLItHPzmDL80EnbSur4EyyAMM+X9+prxLxMXRWjVWeloXfn2N7/azi2T14dV7rBmNcRg qxytMu4gBPaaZitoz0DzA5UUDOY6X+dZQxs+g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=XX8XQyvWYABsbOtgKBkuSaOlwfuBt+xUEco04TKw2SpDkBSc4ns9DUmYKlZc+uElte ktVVVEeFYm9D0ciwYIJAwdDGzdjSMa6dG678I4tbdq/nErX+stc7BnFk1xU0ktRzU3Sd Lhk50hfPZXdhBZuYS68EBq8eT2jzXs1+Srit4= MIME-Version: 1.0 In-Reply-To: References: Date: Sun, 15 May 2011 04:22:33 +1000 Subject: Re: Converting a set into list From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 14 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1305397356 news.xs4all.nl 34849 [::ffff:82.94.164.166]:53240 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5376 On Sun, May 15, 2011 at 12:14 AM, TheSaint wrote: > newset= set(myset1) & set(myset2) > list= [newset] > > << [{'bla', 'alb', 'lab'}] > > Probably list(set) is not like [set]. list(set) creates a list out of the set. [set] creates a list with one element, the set itself. It's not a copy of the set, it's another reference to the same set; change one and you'll see the change in the other. Chris Angelico