Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #81268
| Return-Path | <rosuav@gmail.com> |
|---|---|
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.003 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; '22,': 0.09; 'append': 0.09; 'literal': 0.09; 'lst': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'itself.': 0.14; 'expression,': 0.16; 'expression.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'itself,': 0.16; 'stuff.': 0.16; 'syntax,': 0.16; 'tuple': 0.16; 'tuples,': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'first.': 0.19; 'possible,': 0.19; 'code,': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'comments': 0.31; 'breaking': 0.31; "d'aprano": 0.31; 'steven': 0.31; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'doing': 0.36; 'possible': 0.36; 'list': 0.37; 'nov': 0.38; 'pm,': 0.38; 'itself': 0.39; 'simply': 0.61; 'refer': 0.63; 'special': 0.74; 'whereas': 0.91; 'to:none': 0.92 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=p2G2zkDpn4GZOIwywpbb5UtBSDwjLWC/v3QWMifyook=; b=WG/vmraXTFT1IY0A3HMMicqrb4+t4lSkY0XU2hc7hqDUhjwNxGUVkHgwQARBgcUoOL 93oOmuFUYjD+3HGVQP+RWXMGzTzlrlUPmbaTHX+cCfZfnHeysGvXN3+Os/xLKumwHq+F 3OmrYQtniZAMHgJ6JxRi+Annt8lheWWMPUi3vmqMx1fMAdSm3lhWx5toxSfm919bLnMT z/C3NIIYFBvApI5Iv+eVqjdMEYXoYKS0melNexEn+BE4qXlhTRqWOC/4Z+0gE1tnVwCV g9U4+R9iQr3wndGRj9lDYuxWwCDk0vasejCvSmTR5YsEBFcTKI0t3i7WC9t7HdWMPGYI lv4g== |
| MIME-Version | 1.0 |
| X-Received | by 10.107.134.39 with SMTP id i39mr7917513iod.53.1416631812067; Fri, 21 Nov 2014 20:50:12 -0800 (PST) |
| In-Reply-To | <54701468$0$12986$c3e8da3$5496439d@news.astraweb.com> |
| References | <931d12c0-12b3-4278-a9b9-1e2c32f138b3@googlegroups.com> <87bno16nsw.fsf@elektro.pacujo.net> <mailman.16114.1416591558.18130.python-list@python.org> <54701468$0$12986$c3e8da3$5496439d@news.astraweb.com> |
| Date | Sat, 22 Nov 2014 15:50:12 +1100 |
| Subject | Re: Infinitely nested containers |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| 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> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.16134.1416631815.18130.python-list@python.org> (permalink) |
| Lines | 22 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1416631815 news.xs4all.nl 2907 [2001:888:2000:d::a6]:58262 |
| X-Complaints-To | abuse@xs4all.nl |
| Path | csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
| Xref | csiph.com comp.lang.python:81268 |
Show key headers only | View raw
On Sat, Nov 22, 2014 at 3:43 PM, Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote: > random832@fastmail.us wrote: > >> There's no reason not to allow it with tuples, but you can't do it. >> Mainly because doing it in a single literal would require special >> syntax, whereas you can simply append to a list a reference to itself. > > You can't append a list to itself in a single expression, you have to create > the list first. It's possible to have a list directly refer to itself: lst = [] lst.append(lst) It's not possible, with pure Python code, to create a tuple with a reference to itself, because you have to create a tuple with a single expression. Hence the comments about using the C API... and breaking stuff. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Infinitely nested containers Gill Shen <gillarete@gmail.com> - 2014-11-20 21:54 -0800
Re: Infinitely nested containers Marko Rauhamaa <marko@pacujo.net> - 2014-11-21 09:00 +0200
Re: Infinitely nested containers random832@fastmail.us - 2014-11-21 12:39 -0500
Re: Infinitely nested containers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-22 15:43 +1100
Re: Infinitely nested containers Chris Angelico <rosuav@gmail.com> - 2014-11-22 15:50 +1100
Re: Infinitely nested containers Rustom Mody <rustompmody@gmail.com> - 2014-11-21 21:02 -0800
Re: Infinitely nested containers Chris Angelico <rosuav@gmail.com> - 2014-11-22 16:09 +1100
Re: Infinitely nested containers Rustom Mody <rustompmody@gmail.com> - 2014-11-21 22:03 -0800
Re: Infinitely nested containers Ethan Furman <ethan@stoneleaf.us> - 2014-11-22 11:50 -0800
Re: Infinitely nested containers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-23 16:59 +1100
Re: Infinitely nested containers random832@fastmail.us - 2014-11-23 01:39 -0500
Re: Infinitely nested containers Chris Angelico <rosuav@gmail.com> - 2014-11-22 04:47 +1100
Re: Infinitely nested containers random832@fastmail.us - 2014-11-21 12:50 -0500
Re: Infinitely nested containers Ian Kelly <ian.g.kelly@gmail.com> - 2014-11-21 11:37 -0700
Re: Infinitely nested containers Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-11-21 13:30 -0600
Re: Infinitely nested containers Terry Reedy <tjreedy@udel.edu> - 2014-11-22 16:57 -0500
Re: Infinitely nested containers Chris Angelico <rosuav@gmail.com> - 2014-11-21 18:03 +1100
Re: Infinitely nested containers Ian Kelly <ian.g.kelly@gmail.com> - 2014-11-21 10:13 -0700
csiph-web