Path: csiph.com!usenet.pasdenom.info!gegeweb.org!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3a.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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '(python': 0.07; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'none)': 0.09; '~ethan~': 0.09; 'python': 0.11; 'crashed': 0.16; 'filename:fname piece:signature': 0.16; 'tuple': 0.16; 'tuple,': 0.16; 'tuple.': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'fine': 0.24; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; "d'aprano": 0.31; 'depth': 0.31; 'steven': 0.31; 'version': 0.36; 'charset:us-ascii': 0.36; 'list': 0.37; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:173': 0.61; 'protection': 0.63; 'special': 0.74; 'measure.': 0.84 Date: Sat, 22 Nov 2014 11:50:19 -0800 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Infinitely nested containers References: <931d12c0-12b3-4278-a9b9-1e2c32f138b3@googlegroups.com> <87bno16nsw.fsf@elektro.pacujo.net> <54701468$0$12986$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: <54701468$0$12986$c3e8da3$5496439d@news.astraweb.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PArri2V8NvjJ1f8wCn7J5N2jlt7t0uF94" 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: 52 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416685847 news.xs4all.nl 2868 [2001:888:2000:d::a6]:56909 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81300 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PArri2V8NvjJ1f8wCn7J5N2jlt7t0uF94 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable On 11/21/2014 08:43 PM, Steven D'Aprano wrote: > random832@fastmail.us wrote: >>=20 >> I think I tried on at least one python version and printing the tuple >> crashed with a recursion depth error, since it had no special protecti= on >> for this case the way list printing does. >=20 > It works fine now (Python 3.3). >=20 > py> L =3D [] > py> t =3D (L, None) > py> L.append(L) > py> L.append(t) # For good measure. > py> print(t) > ([[...], (...)], None) This is a tuple in a list in a tuple, not a tuple in a tuple. -- ~Ethan~ --PArri2V8NvjJ1f8wCn7J5N2jlt7t0uF94 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBAgAGBQJUcOkMAAoJENZ7D1rrH75NSZIQAMPyiHmwtEkNc8OaBg3P/hze G4qPa6xrrDVxUFR6QcoxjLSttEsezFchXsnSpZZvHKGUvhafLlu0+GS3jWCW4KWa GJ7NXVQwcI8UHldcn9mj7FeCPs2IpngZZpA9wpK9UZKCv6PBdVTXOI3QOFKIMjYp MzOfXXDItGsgv89OYOhepQCYc64B6SBr99ue2ZgqGUWU8NPifJcdIPbH78BgHh/+ rkuGkxM8isCbyoZnrxhPq4mBRSRpCiW1UdapD8s2ibPy7rMEZOWmnz7Mc68u59ar AzEWIPh4hALaJFRXwsVI9FLFQX5TVNcZIxvTFfYxtdwBOdMycfawaePyTKKxsDiH f/nsNQkkq01TM8vfsGuVQpxx1uQIk3Q0ykSyiwlkmcJWgR0NmF2aF1ZDgJ6MUR3K 2ngpNV5zzPGqsSVwjxO8Z/VMRZG8pqapd0RQFxrXhOkuEhLiRsML+ROIYErZ3WXT GZnoo6uLfz0VHWMBrtizrPFIwAEyCQNho2JZ4+7gLLbJcO7Nv89KyrXjOuVSs9s+ JctxJA2ti2kAfnD3CjtR3HAJ+ezlIsN7P9syrbecLmwLlhNWN2uF+RwiU7FS6+4c T4tdfWEMmafhg8XvctdOyvu7uO7Ajnx88Wq8AVdSe7+TdU47e8lmRaMhQvCwtj6S C48aL5AZfN3DHLNz2qHr =RcFa -----END PGP SIGNATURE----- --PArri2V8NvjJ1f8wCn7J5N2jlt7t0uF94--