X-Received: by 10.224.190.193 with SMTP id dj1mr6351339qab.6.1356093513938; Fri, 21 Dec 2012 04:38:33 -0800 (PST) Received: by 10.49.94.99 with SMTP id db3mr1819155qeb.2.1356093513914; Fri, 21 Dec 2012 04:38:33 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!ee4no1468335qab.0!news-out.google.com!k2ni865qap.0!nntp.google.com!ee4no1520069qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.python Date: Fri, 21 Dec 2012 04:38:33 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2.2.8.199; posting-account=cEyVOAoAAAAQ26Zg5AgQClqyybEKp-yz NNTP-Posting-Host: 2.2.8.199 References: <50D256B3.4070709@udel.edu> <96edb672-dabd-4ab8-9e7c-3fa7f4a91437@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Brython - Python in the browser From: Pierre Quentel Cc: python-list@python.org Injection-Date: Fri, 21 Dec 2012 12:38:33 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.python:35284 > If that's your intention, then instead of coming up with something totally > new, unpythonic and ugly, why not take the normal Python route and > implement a subset of the ElementTree API? > > Stefan Because the tree implementation in ElementTree or other tree modules in Python require a lot of typing and parenthesis To produce the HTML code
hello world
these modules require writing something like div = Tag('DIV') div.appendChild(TextNode('hello ')) b = Tag('B') b.appendChild(TextNode('world')) div.appendChild(b) doc.appendChild(div) With the tree syntax proposed in Brython it would just be doc <= DIV('hello '+B('world')) If "pythonic" means concise and readable, which one is more pythonic ?