Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.x-privat.org!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'syntax': 0.03; 'subject:Python': 0.05; 'python': 0.09; 'subset': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; "'))": 0.16; 'pythonic': 0.16; 'stefan': 0.17; 'typing': 0.17; 'proposed': 0.20; 'doc': 0.22; 'new,': 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header :In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'skip:b 30': 0.27; 'tree': 0.27; 'concise': 0.29; "skip:' 10": 0.30; 'code': 0.31; 'implement': 0.32; 'skip:d 20': 0.34; 'received:google.com': 0.34; 'received:209.85': 0.35; 'something': 0.35; 'modules': 0.36; 'totally': 0.36; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'instead': 0.39; 'your': 0.60; 'world': 0.63; 'more': 0.63; 'route': 0.84; 'ugly,': 0.84 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 References: <50D256B3.4070709@udel.edu> <96edb672-dabd-4ab8-9e7c-3fa7f4a91437@googlegroups.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 2.2.8.199 MIME-Version: 1.0 Subject: Re: Brython - Python in the browser From: Pierre Quentel To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 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: , Message-ID: Lines: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1356093522 news.xs4all.nl 6879 [2001:888:2000:d::a6]:36341 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35286 > 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 ?