Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Oscar Benjamin Newsgroups: comp.lang.python Subject: Re: How to union nested Sets / A single set from nested sets? Date: Wed, 6 Jan 2016 14:45:01 +0000 Lines: 13 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de D/DxixTFapm7+AfoipH0pQoe5KvW6hKODh+YrBYgYOxA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.027 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'cc:addr:python-list': 0.09; 'subject:How': 0.09; 'subject:set': 0.09; "'b',": 0.16; '2016': 0.16; 'cc:name:python list': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'set,': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'forming': 0.22; 'sets': 0.23; 'header:In-Reply-To:1': 0.24; 'message-id:@mail.gmail.com': 0.27; "i'm": 0.30; 'getting': 0.33; 'received:google.com': 0.35; 'i.e.': 0.35; 'skip:i 20': 0.36; 'there': 0.36; 'received:209.85': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'january': 0.38; 'received:209': 0.38; 'subject:from': 0.39; 'where': 0.40; 'subject: / ': 0.63; 'union': 0.67; 'as:': 0.79; 'oscar': 0.84; 'subject:Sets': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=U+i1s56RtC+12v1qwpRKq7+twVXudzuTbJjX9rMOZWw=; b=uPUGyiS2jXqYujGSKlRx2c/lwjlRBkW4ohjURUs8Ur9zZ55XqdzPJeEo1yUr3xV5Zz L1WvWxeh0YSOIivve664QgmAtqwI1GpagaF/tbdN+yek9XoGYBRN4Q/toFj269Xl5pah 9xADrAlZQqfL0Sq2l6sTQ3LAYIbIrnsxnaJIpWrCGWfGCgMDBzkbTcEX1oNIhRRpZhVh 5iblouqRRlNpRAWmorE42+tQVkW97ebzgsCynXe3lhnUgbeh8dhqbfyYKpuYtTdQHVTD gx8RdwH/XKK1a3Wcx3ge7hfa0RjxDw0cZqsX6RJYJvh0k+CF2jQH2aYuqm/B9tK1O+7L 4myw== X-Received: by 10.112.181.196 with SMTP id dy4mr19070810lbc.42.1452091520797; Wed, 06 Jan 2016 06:45:20 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:101302 On 4 January 2016 at 02:40, mviljamaa wrote: > I'm forming sets by set.adding to sets and this leads to sets such as: > > Set([ImmutableSet(['a', ImmutableSet(['a'])]), ImmutableSet(['b', 'c'])]) > > Is there way union these to a single set, i.e. get > > Set(['a', 'b', 'c']) Where are you getting Set and ImmutableSet from? Is that sympy or something? -- Oscar