Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #35356

Re: Brython - Python in the browser

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@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; 'python,': 0.02; 'operator': 0.03; 'skip:[ 20': 0.03; 'subject:Python': 0.05; 'incompatible': 0.07; '22,': 0.09; 'formatted': 0.09; 'integers': 0.09; 'itself,': 0.09; 'modulo': 0.09; 'received:mail- vb0-f46.google.com': 0.09; 'splitting': 0.09; 'sure,': 0.09; 'tuple': 0.09; '"this': 0.13; 'language': 0.14; 'dec': 0.15; 'result.': 0.15; 'sat,': 0.15; '"g"': 0.16; '10:05': 0.16; 'child.': 0.16; 'division,': 0.16; 'division.': 0.16; 'formatting,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'instance:': 0.16; 'operator.': 0.16; 'parts,': 0.16; 'worst': 0.16; 'string': 0.17; 'wrote:': 0.17; 'certainly': 0.17; 'integer': 0.17; 'mathematical': 0.17; "shouldn't": 0.17; 'string,': 0.17; 'received:209.85.212.46': 0.18; 'appropriate': 0.20; 'equivalent': 0.20; 'bit': 0.21; 'either.': 0.22; 'names.': 0.22; "i'd": 0.22; 'somebody': 0.23; 'this:': 0.23; "haven't": 0.23; 'header:In-Reply-To:1': 0.25; 'possibly': 0.27; 'message- id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'received:209.85.212': 0.28; 'chris': 0.28; "d'aprano": 0.29; 'equality': 0.29; 'prints': 0.29; 'steven': 0.29; 'strings,': 0.29; "we're": 0.30; 'connection': 0.30; 'sense': 0.31; 'point': 0.31; '(and': 0.32; 'could': 0.32; 'print': 0.32; 'skip:s 30': 0.33; 'done,': 0.33; 'programming,': 0.33; 'text,': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'similar': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'add': 0.36; 'except': 0.36; 'but': 0.36; 'bad': 0.37; 'itself': 0.37; 'does': 0.37; 'why': 0.37; 'quite': 0.37; 'rather': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'mean': 0.38; 'description': 0.39; 'to:addr:python.org': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'easy': 0.60; 'relationship': 0.60; 'between': 0.63; 'close': 0.63; 'different': 0.63; 'ever': 0.63; 'show': 0.63; 'taking': 0.65; 'learned': 0.65; 'connection.': 0.75; '"oh,': 0.84; 'inherent': 0.84; 'presumably': 0.84; 'spell': 0.91
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:to :content-type; bh=A1h6U0LqVJuqHWqvHH/eMtbnImYZuCcmHvD8nV4gaj4=; b=ePgo9+Dn34py8tRNoLzhzCtB7mVm6EcoGd0lZFSW9hzynWtMf2aKXkmNSq56b/lbvG 3MftpJiFSXGI0tMMOKxKwXnsIxPuLvJcedMAXTtgpz36rMOKI2suLw+MLlDmkN2vS3rJ 4cBMX9onuHiP8Bkw+OketLW2ABWTkoU/RbMKOkCWyEaE6+4nJZEPbCWf3GnzMqpPu7k2 D+ISKWLrzUg9sLyR0c8ncDoH28wkcjqRpT9CowZ5kxqEKh/BmgwIsInchv8EGZ1Rephi kZtN6h26/ylLdxLEKtvP/YrcNQ/gqhJCMHBKUUJ2WhjLyCYrHf9ARjKq4LBZdBzX8E6j Yb2w==
MIME-Version 1.0
In-Reply-To <50d593e1$0$29967$c3e8da3$5496439d@news.astraweb.com>
References <c0be76ec-d55b-4f6c-9892-a80b482ff5bb@googlegroups.com> <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> <CALwzidm0Q3wYESnMGQzBcdUhMXgwmnXFHgieJ_AhtWTECxO2Pg@mail.gmail.com> <CALwzidmh25wsKopUcpCGLy2fpZQeEq=NF2SWVv9=m3wvrgfMoQ@mail.gmail.com> <mailman.1179.1356134903.29569.python-list@python.org> <30bf668f-56e5-482f-b540-5cfa136348d1@googlegroups.com> <mailman.1188.1356165094.29569.python-list@python.org> <62459a43-88e7-4619-9742-a88021bb06ee@googlegroups.com> <mailman.1191.1356167308.29569.python-list@python.org> <50d593e1$0$29967$c3e8da3$5496439d@news.astraweb.com>
Date Sat, 22 Dec 2012 23:11:00 +1100
Subject Re: Brython - Python in the browser
From Chris Angelico <rosuav@gmail.com>
To 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.1195.1356178264.29569.python-list@python.org> (permalink)
Lines 68
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1356178264 news.xs4all.nl 6943 [2001:888:2000:d::a6]:45629
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:35356

Show key headers only | View raw


On Sat, Dec 22, 2012 at 10:05 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> On Sat, 22 Dec 2012 20:08:25 +1100, Chris Angelico wrote:
>
>> I don't see "string % tuple" as a good syntax; I prefer to spell it
>> sprintf("format",arg,arg,arg).
>
> Very possibly one of the worst names ever from a language that excels at
> bad names. "Sprint f"? WTF?
>
> Certainly not appropriate for Python, where a sprintf equivalent would
> return a new string, rather than automatically print the result. Oh
> wait... C's sprintf doesn't automatically print either.
>
> *wink*

Sure, it's not ideal, but it's the string-returning form of printf,
which prints formatted text, so it's not completely inappropriate. But
my point stands: it's an easy thing to search for.

>> When it
>> comes to operators on strings, what I'd prefer to see is something that
>> does more-or-less what the operator does with integers - for instance:
>>
>> "This is a string" / " " ==> ["This","is","a","string"]
>
> I don't see the connection between the above and numeric division. If it
> were this:
>
> "This is a string" / 3 ==> ["This ", "is a ", "strin", "g"]
>
> (and presumably // 3 would be the same except the "g" would be dropped)
> then I could see the connection. But there's no relationship between
> numeric division, which divides a number up into N equal-sized parts, and
> string splitting as you show above.

Sure, but it's still dividing. It's a different form of division, but
it still makes sense. "Oh, you're dividing that string by a delimiter.
I'd prefer to call it 'on' a delimiter, but 'by' works." Your
description makes perfectly good sense too, though; however, if:

"This is a string" / 3 ==> ["This ", "is a ", "strin", "g"]
and
"This is a string" // 3 ==> ["This ", "is a ", "strin"]
then
"This is a string" % 3 ==> ["g"] or possibly "g"

which is incompatible with current usage. But that's a meaning that
makes reasonable sense as "modulo".

>> Taking a string modulo a tuple doesn't make any sense in itself,
>
> Taking an integer cross an integer doesn't make any sense if you haven't
> learned the meaning of the + operator. Why insist that only string
> operators must make inherent sense to somebody who doesn't know what the
> operator means? If we're allowed to learn the meaning of + * and &, why
> not % as well?

Sure, but + and * have meaning in mathematics, not just programming,
and it's a similar meaning. Even the much-maligned = assignment, which
has quite a different meaning to = equality, which itself isn't the
same as the = equality in mathematics, is sufficiently close that it's
grokkable. But someone coming from a mathematical background has no
particular advantage in figuring out that % means formatting, or that
<= means add child. That doesn't mean they shouldn't be done, just
that the justification hump is that bit higher.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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