Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed4.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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'syntax': 0.04; '21,': 0.07; 'python3': 0.07; 'cc:addr:python-list': 0.11; 'python': 0.11; 'jan': 0.12; 'wrote': 0.14; '(unknown,': 0.16; '-tkc': 0.16; '11:09': 0.16; '2.7.3': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'python2.5': 0.16; 'received:174.136': 0.16; 'syntaxerror:': 0.16; 'url:whatsnew': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'bit': 0.19; "hasn't": 0.19; '>>>': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; 'looks': 0.24; 'cc:2**0': 0.24; '2010,': 0.27; 'header:In- Reply-To:1': 0.27; 'chris': 0.29; 'sets': 0.30; 'skip:( 20': 0.30; '"",': 0.31; 'sets.': 0.31; 'file': 0.32; 'linux': 0.33; 'url:python': 0.33; 'charset:us-ascii': 0.36; 'url:org': 0.36; 'received:10': 0.37; 'nov': 0.38; 'pm,': 0.38; 'even': 0.60; 'first': 0.61; 'more': 0.64; 'to:addr:gmail.com': 0.65; 'mar': 0.68; 'invalid': 0.68; 'url:4': 0.69; '2014,': 0.84; '2015': 0.84; '2013,': 0.91; 'wait,': 0.93 X-Sender-Id: wwwh|x-authuser|tim@thechases.com X-Sender-Id: wwwh|x-authuser|tim@thechases.com X-MC-Relay: Neutral X-MailChannels-SenderId: wwwh|x-authuser|tim@thechases.com X-MailChannels-Auth-Id: wwwh X-MC-Loop-Signature: 1421844787465:990256592 X-MC-Ingress-Time: 1421844787464 Date: Wed, 21 Jan 2015 06:55:03 -0600 From: Tim Chase To: Chris Angelico Subject: Re: Trees In-Reply-To: References: <87ppa9944t.fsf@elektro.pacujo.net> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AuthUser: tim@thechases.com Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 69 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1421844798 news.xs4all.nl 2960 [2001:888:2000:d::a6]:55524 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:84114 On 2015-01-21 23:35, Chris Angelico wrote: > On Wed, Jan 21, 2015 at 11:09 PM, Rustom Mody wrote > > Its a bit of a nuisance that we have to write set([1,2,3]) for > > the first > > Wait, what? > > rosuav@sikorsky:~$ python > Python 2.7.3 (default, Mar 13 2014, 11:03:55) > [GCC 4.7.2] on linux2 > Type "help", "copyright", "credits" or "license" for more > information. > >>> type({1,2,3}) > > >>> > rosuav@sikorsky:~$ python3 > Python 3.5.0a0 (default:4709290253e3, Jan 20 2015, 21:48:07) > [GCC 4.7.2] on linux > Type "help", "copyright", "credits" or "license" for more > information. > >>> type({1,2,3}) > > >>> > > Looks like {1,2,3} works for me. That hasn't always worked: tim@bigbox:~$ python2.5 Python 2.5.5 (r255:77872, Nov 28 2010, 16:43:48) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> type({1,2,3}) File "", line 1 type({1,2,3}) ^ SyntaxError: invalid syntax tim@bigbox:~$ python2.6 Python 2.6.8 (unknown, Jan 26 2013, 14:35:25) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> type({1,2,3}) File "", line 1 type({1,2,3}) ^ SyntaxError: invalid syntax And, prior to 2.4, you had to write from sets import Set as set to even get sets. https://docs.python.org/2/whatsnew/2.4.html#pep-218-built-in-set-objects -tkc