Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #58936
| Path | csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <joshua.landau.ws@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'value,': 0.04; 'explicitly': 0.05; 'subject:Python': 0.06; 'float': 0.07; 'odd': 0.07; 'skip:` 10': 0.07; 'variables': 0.07; 'default.': 0.09; 'function,': 0.09; 'implements': 0.09; 'to)': 0.09; 'trailing': 0.09; 'truncated': 0.09; 'variant': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'brackets.': 0.16; 'comma': 0.16; 'dictionaries': 0.16; 'division.': 0.16; 'evaluating': 0.16; 'higher-level': 0.16; 'magic': 0.16; 'optimised': 0.16; 'readable': 0.16; 'sane': 0.16; 'subject:user': 0.16; 'toolbox': 0.16; 'tutorials.': 0.16; 'language': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'obviously': 0.18; 'bit': 0.19; 'thoughts': 0.19; 'select': 0.22; 'programming': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; 'integer': 0.24; 'new,': 0.24; 'simpler': 0.24; 'skip:` 20': 0.24; '(or': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'point': 0.28; 'statement': 0.30; 'message- id:@mail.gmail.com': 0.30; 'along': 0.30; "i'm": 0.30; 'gives': 0.31; '(unless': 0.31; 'bad.': 0.31; 'cgi': 0.31; 'division': 0.31; 'perl': 0.31; 'though.': 0.31; 'anyone': 0.31; 'class': 0.32; 'probably': 0.32; 'languages': 0.32; 'another': 0.32; 'quite': 0.32; 'open': 0.33; 'everyone': 0.33; 'bugs': 0.33; 'cases': 0.33; 'level.': 0.33; "i'd": 0.34; 'could': 0.34; 'tool': 0.35; 'convert': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; "he's": 0.36; 'largely': 0.36; 'done': 0.36; 'useful': 0.36; 'subject:New': 0.37; 'two': 0.37; 'list': 0.37; 'level': 0.37; 'work?': 0.38; 'von': 0.38; 'rather': 0.38; 'little': 0.38; 'does': 0.39; 'flow': 0.39; 'sure': 0.39; 'subject: / ': 0.60; 'most': 0.60; 'mentioned': 0.61; 'john': 0.61; "you're": 0.61; 'first': 0.61; 'advanced': 0.63; 'high': 0.63; 'myself': 0.63; 'him,': 0.64; 'more': 0.64; 'different': 0.65; 'youtube': 0.65; 'past.': 0.68; 'statement,': 0.68; 'grow': 0.77; 'avoids': 0.84; 'fortunately,': 0.84; 'level"': 0.84; 'message)': 0.84; 'weaker': 0.84; 'good,': 0.91; 'imagine': 0.93; '2013': 0.98; 'mr.': 0.98 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=dnhzgVIP6JX90q/83GvkaeNk4xtDESk9pzQCUwCaCds=; b=ipZ2H5IE8uOtVqogTqlj1XOkTsy8WnAtzU1otdFf1Ka6UTwNAKGcwYOQ+aQLkk8tuM /+os4eX5kRHlEdej11BLKY42uxMkuvAnJCoWgfI3gc1/Bhswhjc2Qpqr2OL+QSjmD7Ks BSucNcrFUJRuRwegmNYH6d6cGCEcV70PKhiJPQCCd4AadIV/hqsHKVsbOV5JKxT4uTXm buAyAN6GmHh5YzxU6mC+2FZy4PAkiQ6ct3VUmpmDEJNsA9NvodjYo6dA3m0LA2KWlkV7 2dGCCUjIOJJIQ5QOtllJ/oeLNePxEelo74tt1VRe0y6HVFma1gKojtZ1jwVU+e/wINJr QdVQ== |
| X-Received | by 10.152.216.167 with SMTP id or7mr14743763lac.10.1384003662118; Sat, 09 Nov 2013 05:27:42 -0800 (PST) |
| MIME-Version | 1.0 |
| Sender | joshua.landau.ws@gmail.com |
| In-Reply-To | <-JadnUirYuhUruPPnZ2dnUVZ8rSdnZ2d@bt.com> |
| References | <-JadnUirYuhUruPPnZ2dnUVZ8rSdnZ2d@bt.com> |
| From | Joshua Landau <joshua@landau.ws> |
| Date | Sat, 9 Nov 2013 13:27:02 +0000 |
| X-Google-Sender-Auth | HSEVDghiPxm4mfX58H87fn6MC_o |
| Subject | Re: New user's initial thoughts / criticisms of Python |
| To | John von Horn <j.h69@btinternet.com> |
| Content-Type | text/plain; charset=UTF-8 |
| Cc | python-list <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 <python-list.python.org> |
| List-Unsubscribe | <https://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 | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2294.1384004023.18130.python-list@python.org> (permalink) |
| Lines | 67 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1384004023 news.xs4all.nl 15940 [2001:888:2000:d::a6]:53386 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:58936 |
Show key headers only | View raw
On 9 November 2013 13:08, John von Horn <j.h69@btinternet.com> wrote:
> I'm Mr. Noobie here, I've just started easing into Python (2.7.4) and am
> enjoying working along to some youtube tutorials. I've done a little
> programming in the past.
>
> I've just got a few thoughts I'd like to share and ask about:
>
> * Why not allow floater=float(int1/int2) - rather than floater=float
> (int1)/float(int2)?
>
> Give me a float (or an error message) from evaluating everything in the
> brackets. Don't make me explicitly convert everything myself (unless I
> want to)
In Python 2, `int1/int2` does integer division. So
`float(that_result)` gives a truncated float.
`int1/float(int2)` obviously avoids this by dividing by a float.
If `float(int1/int2)` were to return the same value, `float` could not
be a normal function, and would have to be magic. Magic is bad.
Fortunately, Python 3 does the sane thing and just does floating-point
division by default. Great, eh?
> * No sign of a select .. case statement
>
> Another useful tool in the programmer's toolbox
>
> Select DayofWeek
>
> case "mon"
>
> ...
>
> end select
`select` is quite an odd statement, in that in most cases it's just a
weaker variant of `if`. By the time you're at the point where a
`select` is actually more readable you're also at the point where a
different control flow is probably a better idea. Things like
dictionaries or a variables pointing to functions are really useful
and can be encapsulated in a class quite well. This is a bit more
advanced but largely more rigorous.
But most of the time the idea is just that an `if` is more explicit,
and it's not like a `case` statement can be optimised as it can in
lower-level languages with simpler datatypes.
> * Call me pedantic by why do we need a trailing comma for a list of one
> item? Keep it intuitive and allow lstShopping=[] or ["Bread"] or
> ["Bread", "Milk","Hot Chocolate"] I don't like ["Bread",]. It bugs me.
You don't.
You might be confused because you need to write `("hello",)`, but
that's because the *comma* makes a *tuple*, not the brackets. Imagine
if `2 * (1/2)` gave you `(0.5, 0.5)`!
> Is everyone happy with the way things are? Could anyone recommend a good,
> high level language for CGI work? Not sure if I'm going to be happy with
> Perl (ahhh, get him, he's mentioned Perl and is a heretic!) or Python. I
> would very much value any constructive criticism or insights.
I don't know squat about CGI, but I think Python can grow on anyone
open to the idea of programming at a high level. Not "high level" as
in "expert" but as in "using higher-level constructs", if you get the
meaning. Python implements these quite well. Your first two complaints
are not new, though.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
New user's initial thoughts / criticisms of Python John von Horn <j.h69@btinternet.com> - 2013-11-09 07:08 -0600
Re: New user's initial thoughts / criticisms of Python Ned Batchelder <ned@nedbatchelder.com> - 2013-11-09 05:22 -0800
Re: New user's initial thoughts / criticisms of Python Joshua Landau <joshua@landau.ws> - 2013-11-09 13:27 +0000
Re: New user's initial thoughts / criticisms of Python Jonathan <jtcegh@gmail.com> - 2013-11-09 14:44 -0800
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-10 10:29 +1100
Re: New user's initial thoughts / criticisms of Python MRAB <python@mrabarnett.plus.com> - 2013-11-10 00:50 +0000
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-10 11:54 +1100
Re: New user's initial thoughts / criticisms of Python Neil Cerutti <neilc@norwich.edu> - 2013-11-11 15:30 +0000
Re: New user's initial thoughts / criticisms of Python Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2013-11-10 13:24 +0100
Re: New user's initial thoughts / criticisms of Python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-09 13:41 +0000
Re: New user's initial thoughts / criticisms of Python Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-11-09 16:24 +0200
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-10 01:27 +1100
Sandboxing Python [was Re: New user's initial thoughts / criticisms of Python] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-09 15:25 +0000
Re: Sandboxing Python [was Re: New user's initial thoughts / criticisms of Python] Chris Angelico <rosuav@gmail.com> - 2013-11-10 02:32 +1100
Re: New user's initial thoughts / criticisms of Python Jorgen Grahn <grahn+nntp@snipabacken.se> - 2013-11-10 08:47 +0000
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-10 20:22 +1100
Re: New user's initial thoughts / criticisms of Python Ian Kelly <ian.g.kelly@gmail.com> - 2013-11-10 04:39 -0700
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-10 22:43 +1100
Re: New user's initial thoughts / criticisms of Python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-11-10 12:12 -0500
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-11 10:29 +1100
Re: New user's initial thoughts / criticisms of Python Terry Reedy <tjreedy@udel.edu> - 2013-11-10 19:13 -0500
Re: New user's initial thoughts / criticisms of Python rusi <rustompmody@gmail.com> - 2013-11-09 07:38 -0800
Re: New user's initial thoughts / criticisms of Python Roy Smith <roy@panix.com> - 2013-11-09 10:56 -0500
Re: New user's initial thoughts / criticisms of Python rusi <rustompmody@gmail.com> - 2013-11-09 08:30 -0800
Re: New user's initial thoughts / criticisms of Python Rick Johnson <rantingrickjohnson@gmail.com> - 2013-11-10 21:36 -0800
Re: New user's initial thoughts / criticisms of Python Roy Smith <roy@panix.com> - 2013-11-11 09:01 -0500
Re: New user's initial thoughts / criticisms of Python rusi <rustompmody@gmail.com> - 2013-11-11 07:14 -0800
Re: New user's initial thoughts / criticisms of Python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-11-11 21:05 -0500
Re: New user's initial thoughts / criticisms of Python Ethan Furman <ethan@stoneleaf.us> - 2013-11-12 14:38 -0800
Re: New user's initial thoughts / criticisms of Python John von Horn <j.h69@btinternet.com> - 2013-11-09 14:19 -0600
Re: New user's initial thoughts / criticisms of Python Tim Chase <python.list@tim.thechases.com> - 2013-11-09 14:39 -0600
Re: New user's initial thoughts / criticisms of Python Mark Janssen <dreamingforward@gmail.com> - 2013-11-09 12:33 -0800
Re: New user's initial thoughts / criticisms of Python Ned Batchelder <ned@nedbatchelder.com> - 2013-11-09 12:54 -0800
Re: New user's initial thoughts / criticisms of Python Mark Janssen <dreamingforward@gmail.com> - 2013-11-09 13:21 -0800
Re: New user's initial thoughts / criticisms of Python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-09 21:01 +0000
Re: New user's initial thoughts / criticisms of Python Tim Chase <python.list@tim.thechases.com> - 2013-11-09 15:20 -0600
Re: New user's initial thoughts / criticisms of Python lorenzo.gatti@gmail.com - 2013-11-11 02:09 -0800
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-11 21:39 +1100
Re: New user's initial thoughts / criticisms of Python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-11 11:17 +0000
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-11 22:32 +1100
Re: New user's initial thoughts / criticisms of Python Mark Janssen <dreamingforward@gmail.com> - 2013-11-11 14:29 -0800
Re: New user's initial thoughts / criticisms of Python Robert Kern <robert.kern@gmail.com> - 2013-11-11 11:53 +0000
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-11 23:07 +1100
Re: New user's initial thoughts / criticisms of Python Joshua Landau <joshua@landau.ws> - 2013-11-11 20:50 +0000
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-12 09:21 +1100
Re: New user's initial thoughts / criticisms of Python Joshua Landau <joshua@landau.ws> - 2013-11-12 01:53 +0000
csiph-web