Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #35326
| Path | csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <ian.g.kelly@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'string.': 0.04; 'subject:Python': 0.05; '21,': 0.07; 'builtin': 0.07; 'converts': 0.07; 'parsing': 0.07; 'run,': 0.07; 'string;': 0.07; 'strings.': 0.07; 'api': 0.09; '22,': 0.09; 'expectation': 0.09; 'literal': 0.09; 'objects.': 0.09; 'parsed': 0.09; 'typed': 0.09; 'dec': 0.15; 'sat,': 0.15; 'element,': 0.16; 'hmm.': 0.16; 'literal,': 0.16; 'result:': 0.16; 'string': 0.17; 'wrote:': 0.17; 'element': 0.17; 'integer': 0.17; 'string,': 0.17; '>>>': 0.18; 'code.': 0.20; 'followed': 0.20; 'doc': 0.22; 'seems': 0.23; 'script': 0.24; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'plain': 0.27; '(as': 0.27; 'object,': 0.27; 'message-id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'chris': 0.28; 'bold': 0.29; 'clicked': 0.29; 'document,': 0.29; 'dom': 0.29; 'node': 0.29; 'prints': 0.29; 'str': 0.29; 'fri,': 0.30; 'gets': 0.32; 'structure': 0.32; 'getting': 0.33; 'right?': 0.33; 'text,': 0.33; 'to:addr:python- list': 0.33; 'another': 0.33; 'received:google.com': 0.34; 'text': 0.34; 'adds': 0.35; 'text.': 0.35; 'expected': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'add': 0.36; 'but': 0.36; 'child': 0.36; 'test': 0.36; 'should': 0.36; 'does': 0.37; 'being': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'mean': 0.38; 'object': 0.38; 'gives': 0.39; 'to:addr:python.org': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'tags,': 0.81; '(is': 0.84; 'float,': 0.84; 'to:name:python': 0.84; 'was:': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=l7pIVpudB/p4Q8kvAhwCJt+jxLbwBCHoziSU3HlwfRA=; b=Gt8KTZkYzv3agfGiUMT55P5l57CrWrCyI2dpGrjPM0Ad3TMQe3lq7eCMzb9CrWjeta RjEJtg4PQ+ekQawrNRbWEqd2fjmxFw8TNB63IS9IZS5hKweu2OAtRlZR+l8ze3LE/u3J NdwHb8IsdGWyVQNsyYPbvSp52ZcXq6rr4+j5zbDHv/T1cPlhSXkCxx2vfu+sWymRct9r AsAnuiE2onweeZAjEqoaMr5iGc+D8BW4TY2wrkGJT2wI0jLzhT+uKHqVKh1sQLAX3OOP a8128GBr8AaTSZyok/i9hFL3sEOOBA+YLg5NoDYdgDGfd9864Xw2lpv6TZmOy6HDIznf C6eA== |
| MIME-Version | 1.0 |
| In-Reply-To | <CAPTjJmo-int9pT3iO+bGC9i4GgeeydHGD=Z94DtZKgiS9MhyWQ@mail.gmail.com> |
| References | <c0be76ec-d55b-4f6c-9892-a80b482ff5bb@googlegroups.com> <50D256B3.4070709@udel.edu> <mailman.1082.1355964916.29569.python-list@python.org> <96edb672-dabd-4ab8-9e7c-3fa7f4a91437@googlegroups.com> <mailman.1143.1356089120.29569.python-list@python.org> <c1663198-d1b0-4e7d-b8d8-e1b6d63b4f55@googlegroups.com> <mailman.1146.1356094682.29569.python-list@python.org> <44335f22-555a-4806-b24a-7d4cb1d8e529@googlegroups.com> <mailman.1154.1356104892.29569.python-list@python.org> <4ddee631-b5b5-4cb4-82b0-00ca403b773e@googlegroups.com> <CAPTjJmo-int9pT3iO+bGC9i4GgeeydHGD=Z94DtZKgiS9MhyWQ@mail.gmail.com> |
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | Fri, 21 Dec 2012 16:45:03 -0700 |
| Subject | Re: Brython - Python in the browser |
| To | Python <python-list@python.org> |
| Content-Type | text/plain; charset=ISO-8859-1 |
| 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 | <http://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 | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1174.1356133541.29569.python-list@python.org> (permalink) |
| Lines | 49 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1356133541 news.xs4all.nl 6932 [2001:888:2000:d::a6]:49246 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:35326 |
Show key headers only | View raw
On Fri, Dec 21, 2012 at 3:52 PM, Chris Angelico <rosuav@gmail.com> wrote:
> On Sat, Dec 22, 2012 at 3:36 AM, Pierre Quentel
> <pierre.quentel@gmail.com> wrote:
>>
>>> Hmm. So when that gets added into a DIV, it has to get parsed for
>>> tags? How does this work? This seems very odd. I would have expected
>>> it to remain as DOM objects.
>>
>> In DIV(child) :
>> - if child is a string, integer or float, a text node is added (addChild) to the DIV element, with the string value of child
>> - if child is another DOM element (as in DIV(B('foo'))) then this element is added to the DIV element
>
> Meaning that:
> doc <= <p></p>'
> will add literal text, not a paragraph object, right? That's
> definitely what I would expect.
>
>> doc <= 'blah blah x<y: '+B('True!')
>>
>> It will add a text node to the document, with the string 'blah blah x<y: ' followed by 'True!' in bold characters
>
> This is where it's getting confusing. My expectation of this is that
> it adds a text node with the literal text, followed by a bold node
> with its child text. This operation should never involve the parsing
> of HTML tags, as the document structure is all there in the code. So
> it ought to be a DOM object, not a text string, that gets <='d onto
> doc (is <= a verb now?). That means the result of the addition has to
> be a DOM object, not a text string; but you said that adding a string
> to a B object converts the object to a string and concatenates the
> strings.
>
> Do you see now what I mean about the API being difficult to explain?
In my playing around with it just now, the addition doesn't seem to
actually return a string. I typed this script into the test console:
log('hello ' + B('world'))
and clicked Run, and the result was:
[object Object]
whereas if I just try to log a plain string literal, it actually
prints out the string. Somewhat disturbingly, this also gives the
[object Object] result:
log(str('hello ' + B('world')))
In Brython, the str builtin does not return strings?
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-19 10:19 -0800
Re: Brython - Python in the browser jkn <jkn_gg@nicorp.f9.co.uk> - 2012-12-19 14:59 -0800
Re: Brython - Python in the browser Terry Reedy <tjreedy@udel.edu> - 2012-12-19 19:07 -0500
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-20 01:37 -0800
Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-20 20:56 +1100
Re: Brython - Python in the browser Terry Reedy <tjreedy@udel.edu> - 2012-12-20 18:59 -0500
Re: Brython - Python in the browser Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-21 02:05 +0000
Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-21 16:07 +1100
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 08:16 -0800
Re: Brython - Python in the browser Stefan Behnel <stefan_ml@behnel.de> - 2012-12-21 17:52 +0100
Re: Brython - Python in the browser Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-21 11:31 -0700
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 12:59 -0800
Re: Brython - Python in the browser Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-21 14:17 -0700
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 12:59 -0800
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 08:16 -0800
Re: Brython - Python in the browser Rouslan Korneychuk <rouslank@msn.com> - 2012-12-21 03:31 -0500
Re: Brython - Python in the browser Terry Reedy <tjreedy@udel.edu> - 2012-12-21 04:44 -0500
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-20 01:37 -0800
Re: Brython - Python in the browser Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-19 17:54 -0700
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-20 01:42 -0800
Re: Brython - Python in the browser Stefan Behnel <stefan_ml@behnel.de> - 2012-12-21 12:25 +0100
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 04:38 -0800
Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-21 23:57 +1100
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 07:36 -0800
Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-22 02:48 +1100
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 08:36 -0800
Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-22 09:52 +1100
Re: Brython - Python in the browser Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-21 16:45 -0700
Re: Brython - Python in the browser Amirouche Boubekki <amirouche.boubekki@gmail.com> - 2012-12-22 00:50 +0100
Re: Brython - Python in the browser Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-21 16:51 -0700
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 23:59 -0800
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 23:59 -0800
Re: Brython - Python in the browser Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-21 16:57 -0700
Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-22 11:08 +1100
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 23:57 -0800
Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-22 19:31 +1100
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-22 00:54 -0800
Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-22 20:08 +1100
Re: Brython - Python in the browser Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-22 11:05 +0000
Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-22 23:11 +1100
Re: Brython - Python in the browser Dan Sommers <dan@tombstonezero.net> - 2012-12-22 20:31 +0000
Re: Brython - Python in the browser Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-22 13:53 -0700
Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-23 08:49 +1100
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-22 00:54 -0800
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 23:57 -0800
Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-22 11:09 +1100
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 08:36 -0800
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 07:36 -0800
Re: Brython - Python in the browser Duncan Booth <duncan.booth@invalid.invalid> - 2012-12-21 13:14 +0000
Re: Brython - Python in the browser Stefan Behnel <stefan_ml@behnel.de> - 2012-12-21 14:34 +0100
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 04:38 -0800
Re: Brython - Python in the browser Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-22 02:31 +0000
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-20 01:42 -0800
Re: Brython - Python in the browser Terry Reedy <tjreedy@udel.edu> - 2012-12-19 21:46 -0500
Re: Brython - Python in the browser Jamie Paul Griffin <jamie@kode5.net> - 2012-12-20 11:32 +0000
Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-22 01:01 -0800
csiph-web