On Thu, Sep 23, 2010 at 12:23:22AM +, Steven D'Aprano wrote:
> On Tue, 21 Sep 2010 16:17:48 +0200, Antoon Pardon wrote:
>
> > On Tue, Sep 21, 2010 at 12:07:07AM +, Steven D'Aprano wrote:
> >> On Mon, 20 Sep 2010 19:28:49 +0200, Antoon Pardon wrote:
> >>
> >> > Not necessarily. Some of us
On Thu, 23 Sep 2010 11:42:25 -0400, Andreas Waldenburger wrote:
> On Wed, 22 Sep 2010 20:45:55 -0500 John Bokma
> wrote:
>
>> What surprises me is that this is still discussed. It's like argueing
>> about significant whitespace. :-)
>
> Which is evil!
Iagreethatsignioficantwhitespaceisevil.Py
On 2010-09-23, Andreas Waldenburger wrote:
> On 23 Sep 2010 03:54:52 GMT Seebs wrote:
>> I don't generally like constructs where important structural
>> information comes late in the construct. [snip]
> I think that is precisely the reason that the elements of the list come
> *first* in the list
On Wed, 22 Sep 2010 20:45:55 -0500 John Bokma
wrote:
> What surprises me is that this is still discussed. It's like argueing
> about significant whitespace. :-)
Which is evil!
/W
--
INVALID? DE!
--
http://mail.python.org/mailman/listinfo/python-list
On 23 Sep 2010 00:33:28 GMT Steven D'Aprano
wrote:
> On Tue, 21 Sep 2010 12:26:29 -0400, Andreas Waldenburger wrote:
>
> > On Sat, 18 Sep 2010 19:09:33 -0700 (PDT) Carl Banks
> > wrote:
> >
> >> On Sep 17, 1:01 pm, Andreas Waldenburger
> >> wrote:
> >> > On Thu, 16 Sep 2010 16:20:33 -0400 AK
On 23 Sep 2010 03:54:52 GMT Seebs wrote:
> On 2010-09-23, Steven D'Aprano
> wrote:
> [snip]
> > I don't see anyone bitching about:
>
> > for x in seq:
> > if x:
> > f(x)
>
> > vs
>
> > [f(x) for x in seq if x]
>
> In my case, that's because I only ran into that syntax about an h
On 2010-09-23, John Bokma wrote:
> Seebs writes:
>> I dunno. I like the "next if /^$/" idiom,
> I don't (as a Perl programmer), I prefer:
Huh, those are actually nicer. I didn't know that was possible; it
wouldn't have occurred to me to try to put "next" (which I think
of as a statement) into
Seebs writes:
> I dunno. I like the "next if /^$/" idiom,
I don't (as a Perl programmer), I prefer:
$line =~ /^$/ and next;
Or:
$line ne '' or next;
which I read as: line must not be empty
--
John Bokma j3b
Blog: http://johnbo
On 2010-09-23, Steven D'Aprano wrote:
> On Thu, 23 Sep 2010 01:49:44 +, Seebs wrote:
>> But I do think it's unfair to dismiss it as purely a matter of baby duck
>> syndrome. Consistency in ordering of corresponding idioms seems a
>> reasonable goal.
> I don't see anyone bitching about:
> fo
On Thu, 23 Sep 2010 01:49:44 +, Seebs wrote:
> But I do think it's unfair to dismiss it as purely a matter of baby duck
> syndrome. Consistency in ordering of corresponding idioms seems a
> reasonable goal.
I don't see anyone bitching about:
for x in seq:
if x:
f(x)
vs
[f(x)
On 2010-09-23, Steven D'Aprano wrote:
> Yes, it certainly is. Describing it as "an ugly format" is also a matter
> of taste -- taste which in my opinion simply isn't justified by anything
> other than familiarity.
It may not be convincing to other people, but the logical inversion strikes
me as
Steven D'Aprano writes:
For completeness sake:
code = side == 'l' ? dir[int(num):] : dir[:-1*int(num)]
> code = if side == 'l' then dir[int(num):] else dir[:-1*int(num)]
> code = side == 'l' if dir[int(num):] else dir[:-1*int(num)]
> code = dir[int(num):] if side == 'l' else dir[:-1*int(num)]
On Tue, 21 Sep 2010 12:26:29 -0400, Andreas Waldenburger wrote:
> On Sat, 18 Sep 2010 19:09:33 -0700 (PDT) Carl Banks
> wrote:
>
>> On Sep 17, 1:01 pm, Andreas Waldenburger
>> wrote:
>> > On Thu, 16 Sep 2010 16:20:33 -0400 AK wrote:
>> >
>> > > I also like this construct that works, I think, s
On Tue, 21 Sep 2010 16:17:48 +0200, Antoon Pardon wrote:
> On Tue, Sep 21, 2010 at 12:07:07AM +, Steven D'Aprano wrote:
>> On Mon, 20 Sep 2010 19:28:49 +0200, Antoon Pardon wrote:
>>
>> > Not necessarily. Some of us have the impression that Guido
>> > deliberatly chose an ugly format for the
On Tue, 21 Sep 2010 08:17:00 +, Duncan Booth wrote:
> I guess you have worked hard to forget the and-or hack. It was actually:
>
> condition and true-clause or false-clause
>
> so its not quite the same pattern.
So I did. Oops.
Thanks for the correction.
--
Steven
--
http://mail.pyt
On Sat, 18 Sep 2010 19:09:33 -0700 (PDT) Carl Banks
wrote:
> On Sep 17, 1:01 pm, Andreas Waldenburger
> wrote:
> > On Thu, 16 Sep 2010 16:20:33 -0400 AK wrote:
> >
> > > I also like this construct that works, I think, since 2.6:
> >
> > > code = dir[int(num):] if side == 'l' else dir[:-1*int(nu
On Tue, Sep 21, 2010 at 12:07:07AM +, Steven D'Aprano wrote:
> On Mon, 20 Sep 2010 19:28:49 +0200, Antoon Pardon wrote:
>
> > Not necessarily. Some of us have the impression that Guido deliberatly
> > chose an ugly format for the ternary operator.
>
> If he did, then he must have changed his
Steven D'Aprano wrote:
> That's sheer and unadulterated nonsense. The fact is that Guido changed
> his mind about ternary if after discovering that the work-around
>
> true-clause and condition or false-clause
>
> is buggy -- it gives the wrong answer if true-clause happens to be a
> false va
On Sep 20, 1:29 am, Steven D'Aprano wrote:
> To my eyes, the feature of syntax highlighting that alone makes it
> worthwhile, its killer feature, is that I can set comments and docstrings
> to grey. When I'm scanning code, being able to slide my eyes over greyed-
> out comments and docstrings and
On 09/19/10 17:31, Seebs wrote:
> Basically, think of what happens as I read each symbol:
>
> x = x + 1 if condition else x - 1
>
> Up through the '1', I have a perfectly ordinary assignment of a value.
> The, suddenly, it retroactively turns out that I have misunderstood
> everything
Terry Reedy writes:
>> On 09/19/2010 10:32 PM, John Bokma wrote:
>
>>> the spoiler. Do you fast forward movies as well?
>
> I sometimes watch movies (or parts thereof) on 1.5x, especially if it
> has a lot of 'filler' scenes. But only when my wife is not watching,
> as she hates it.
Heh, my ques
On 2010-09-21, Steven D'Aprano wrote:
> On Mon, 20 Sep 2010 19:28:49 +0200, Antoon Pardon wrote:
>> Not necessarily. Some of us have the impression that Guido deliberatly
>> chose an ugly format for the ternary operator.
> If he did, then he must have changed his mind, because there is nothing
>
AK wrote:
One definite advantage would be that if, say, it takes you 70 pages of a
given novel to figure out whether you like it enough to continue,
If there was that much doubt, I would give up long before
reaching the 70 page mark, regardless of reading speed.
If I'm not hooked by the first
On Mon, 20 Sep 2010 19:28:49 +0200, Antoon Pardon wrote:
> Not necessarily. Some of us have the impression that Guido deliberatly
> chose an ugly format for the ternary operator.
If he did, then he must have changed his mind, because there is nothing
ugly about the ternary operator we ended up w
On 20/09/2010 18:28, Antoon Pardon wrote:
On Sun, Sep 19, 2010 at 11:30:32PM +, Seebs wrote:
On 2010-09-19, MRAB wrote:
On 19/09/2010 22:32, Seebs wrote:
On 2010-09-19, AK wrote:
Because that's what 'if' and 'else' mean.
My point is, I don't want the order of the clauses in if/else
On Mon, Sep 20, 2010 at 11:28 AM, Antoon Pardon <
antoon.par...@rece.vub.ac.be> wrote:
>
> Not necessarily. Some of us have the impression that Guido deliberatly
> chose an ugly format for the ternary operator. Guido has alwasys been
> against a ternary operator but the requests kept coming. So ev
On 2010-09-20, Antoon Pardon wrote:
> Not necessarily. Some of us have the impression that Guido deliberatly
> chose an ugly format for the ternary operator. Guido has alwasys been
> against a ternary operator but the requests kept coming. So eventually
> he introduced one. But the impression is t
On 09/19/2010 10:32 PM, John Bokma wrote:
the spoiler. Do you fast forward movies as well?
I sometimes watch movies (or parts thereof) on 1.5x, especially if it
has a lot of 'filler' scenes. But only when my wife is not watching, as
she hates it.
--
Terry Jan Reedy
--
http://mail.pytho
On Sun, Sep 19, 2010 at 11:30:32PM +, Seebs wrote:
> On 2010-09-19, MRAB wrote:
> > On 19/09/2010 22:32, Seebs wrote:
> >> On 2010-09-19, AK wrote:
> >>> Because that's what 'if' and 'else' mean.
>
> >> My point is, I don't want the order of the clauses in if/else to change.
> >> If it is so
Seebs writes:
> On 2010-09-20, John Bokma wrote:
>> I didn't mean that there are spoilers in the first 70 pages, just that
>> to me the excercise would spoil the book, so, I wouldn't do it. I
>> consider a book like a meal, I wouldn't gobble down food, regurgitate
>> it, and eat it again at a sl
On 2010-09-20, Steven D'Aprano wrote:
> On Sun, 19 Sep 2010 07:36:11 +, Seebs wrote:
>> No, but the syntax should be invisible. When I read English, I don't
>> have to think about nouns and verbs and such unless something is very
>> badly written.
> That's almost certainly because you've bee
On 2010-09-20, Steven D'Aprano wrote:
> I don't know about how other people speed-read, but I can assure you that
> when my wife speed-reads, she's not just scanning a few words and
> interpolating between them. She can give you a detailed summary of what
> *actually* happened, not just a good
On Sun, 19 Sep 2010 07:36:11 +, Seebs wrote:
> On 2010-09-19, Steven D'Aprano
> wrote:
>> I'm not entirely sure I agree with you here... you can't ignore syntax
>> in order to understand the meaning of code.
>
> No, but the syntax should be invisible. When I read English, I don't
> have to
On Sun, 19 Sep 2010 10:29:10 -0400, AK wrote:
> On 09/18/2010 11:28 PM, Steven D'Aprano wrote:
[...]
>> My wife can read scarily fast. It's very something to watch her reading
>> pages as fast as she can turn them, and a few years ago she read the
>> entire Harry Potter series (to date) in one aft
On 2010-09-20, John Bokma wrote:
> I didn't mean that there are spoilers in the first 70 pages, just that
> to me the excercise would spoil the book, so, I wouldn't do it. I
> consider a book like a meal, I wouldn't gobble down food, regurgitate
> it, and eat it again at a slower pace. Books, movi
AK writes:
> On 09/19/2010 10:32 PM, John Bokma wrote:
>> AK writes:
>>
>>> On 09/19/2010 07:18 PM, Gregory Ewing wrote:
AK wrote:
> Afaik the idea is that you can read a novel at the speed of half a page
> a second or so and understand it to the same extent as people who'd rea
On 09/19/2010 10:32 PM, John Bokma wrote:
AK writes:
On 09/19/2010 07:18 PM, Gregory Ewing wrote:
AK wrote:
Afaik the idea is that you can read a novel at the speed of half a page
a second or so and understand it to the same extent as people who'd read
at a normal rate.
I've never underst
On Mon, 20 Sep 2010 11:18:57 +1200, Gregory Ewing wrote:
> AK wrote:
>
>> Afaik the idea is that you can read a novel at the speed of half a page
>> a second or so and understand it to the same extent as people who'd
>> read at a normal rate.
>
> I've never understood why anyone would *want* to
On 2010-09-20, John Bokma wrote:
> Heh, to me speed reading those 70 pages in a very short while,
> concluding that it's a good book, and start over again would be quite
> the spoiler.
I rarely encounter substantive spoilers in the first 70 pages or so of
a book. That said, I'm pretty much immun
AK writes:
> On 09/19/2010 07:18 PM, Gregory Ewing wrote:
>> AK wrote:
>>
>>> Afaik the idea is that you can read a novel at the speed of half a page
>>> a second or so and understand it to the same extent as people who'd read
>>> at a normal rate.
>>
>> I've never understood why anyone would *wa
On 2010-09-20, alex23 wrote:
> AK wrote:
>> When I was reading The book of the new sun, though, I could stop and
>> read a single sentence a few times over and reflect on it for a minute.
> Totally understandable, Wolfe is a far, far greater writer than
> Rowling :)
Certainly true. On the othe
On 09/19/2010 07:18 PM, Gregory Ewing wrote:
AK wrote:
Afaik the idea is that you can read a novel at the speed of half a page
a second or so and understand it to the same extent as people who'd read
at a normal rate.
I've never understood why anyone would *want* to read a
novel that fast, th
AK wrote:
> When I was reading The book of the new sun, though, I could stop and
> read a single sentence a few times over and reflect on it for a minute.
Totally understandable, Wolfe is a far, far greater writer than
Rowling :)
--
http://mail.python.org/mailman/listinfo/python-list
On 2010-09-19, Gregory Ewing wrote:
> AK wrote:
>> Afaik the idea is that you can read a novel at the speed of half a page
>> a second or so and understand it to the same extent as people who'd read
>> at a normal rate.
> I've never understood why anyone would *want* to read a
> novel that fast,
On 2010-09-19, MRAB wrote:
> On 19/09/2010 22:32, Seebs wrote:
>> On 2010-09-19, AK wrote:
>>> Because that's what 'if' and 'else' mean.
>> My point is, I don't want the order of the clauses in if/else to change.
>> If it is sometimes "ifelse", then
>> it should *ALWAYS WITHOUT EXCEPTION* be
AK wrote:
Afaik the idea is that you can read a novel at the speed of half a page
a second or so and understand it to the same extent as people who'd read
at a normal rate.
I've never understood why anyone would *want* to read a
novel that fast, though. For me at least, reading a novel
is some
On 19/09/2010 22:32, Seebs wrote:
On 2010-09-19, AK wrote:
Because that's what 'if' and 'else' mean.
My point is, I don't want the order of the clauses in if/else to change.
If it is sometimes "ifelse", then
it should *ALWAYS WITHOUT EXCEPTION* be condition first, then true clause,
then f
On 2010-09-19, AK wrote:
> Because that's what 'if' and 'else' mean.
My point is, I don't want the order of the clauses in if/else to change.
If it is sometimes "if else ", then
it should *ALWAYS WITHOUT EXCEPTION* be condition first, then true clause,
then false clause. If it's sometimes "if
On 09/19/2010 02:21 PM, Seebs wrote:
On 2010-09-19, AK wrote:
On 09/19/2010 03:31 AM, Seebs wrote:
Just like:
if condition:
foo
else:
bar
The condition is the primary, the clauses are secondary to it.
To me, the problem with C ternary is, why is tr
On 2010-09-19, AK wrote:
> On 09/19/2010 03:31 AM, Seebs wrote:
>> Just like:
>> if condition:
>> foo
>> else:
>> bar
>> The condition is the primary, the clauses are secondary to it.
> To me, the problem with C ternary is, why is true condition first and
> false seco
On 09/19/2010 03:36 AM, Seebs wrote:
On 2010-09-19, Steven D'Aprano wrote:
I'm not entirely sure I agree with you here... you can't ignore syntax in
order to understand the meaning of code.
No, but the syntax should be invisible. When I read English, I don't have
to think about nouns and ver
On 09/19/2010 03:31 AM, Seebs wrote:
On 2010-09-19, Steven D'Aprano wrote:
Define "unbalanced".
I'm not sure that's the word I'd use. I'm not even sure what it would mean
here.
Putting aside the over-use of punctuation, The C syntax feels unbalanced
to me. You have:
condition IF true-cl
On 09/18/2010 11:28 PM, Steven D'Aprano wrote:
On Sat, 18 Sep 2010 21:58:58 -0400, AK wrote:
I don't understand this. So far as I know, the phrase "speed reading"
refers to various methods of reading much faster than most people read,
and is real but not exceptionally interesting.
Afaik the
On 2010-09-19, Steven D'Aprano wrote:
> I'm not entirely sure I agree with you here... you can't ignore syntax in
> order to understand the meaning of code.
No, but the syntax should be invisible. When I read English, I don't have
to think about nouns and verbs and such unless something is very
On 2010-09-19, Steven D'Aprano wrote:
> Define "unbalanced".
I'm not sure that's the word I'd use. I'm not even sure what it would mean
here.
> Putting aside the over-use of punctuation, The C syntax feels unbalanced
> to me. You have:
> condition IF true-clause ELSE false-clause
> so both c
On Sun, 19 Sep 2010 00:35:14 +, Seebs wrote:
> On 2010-09-19, AK wrote:
>> Funny that you should say that, because I thought quite a few times
>> that it would be really awesome if some texts in English had syntax
>> highlighting. Obviously, not Brothers Karamazov, but something like a
>> tut
On Sat, 18 Sep 2010 21:58:58 -0400, AK wrote:
>> I don't understand this. So far as I know, the phrase "speed reading"
>> refers to various methods of reading much faster than most people read,
>> and is real but not exceptionally interesting.
>
> Afaik the idea is that you can read a novel at t
On Sat, 18 Sep 2010 19:09:33 -0700, Carl Banks wrote:
> Apart from occasions like this and throwaway one-liners I use regular
> if-then statements. If Python had added the C-like a ? b : c, then I'd
> use it a lot more, since that version is not inherently unbalanced.
Define "unbalanced".
Putti
On 09/18/2010 10:12 PM, Seebs wrote:
On 2010-09-19, AK wrote:
On 09/18/2010 08:35 PM, Seebs wrote:
News flash: Not all people think the same way. Film at 11. :)
I've tried to use syntax coloring editors, and I've always found that
they end up making me slower and less accurate at reading
On 2010-09-19, AK wrote:
> On 09/18/2010 08:35 PM, Seebs wrote:
>> That wouldn't be *syntax* highlighting, that'd be *semantic* highlighting.
> In case of programming, the effect is similar.
I have not found that to be the case. It's been exactly the same as syntax
highlighting in English would
On Sep 17, 1:01 pm, Andreas Waldenburger
wrote:
> On Thu, 16 Sep 2010 16:20:33 -0400 AK wrote:
>
> > I also like this construct that works, I think, since 2.6:
>
> > code = dir[int(num):] if side == 'l' else dir[:-1*int(num)]
>
> I wonder when this construct will finally start to look good.
I do
On 09/18/2010 09:08 PM, Dennis Lee Bieber wrote:
On Sat, 18 Sep 2010 20:00:32 -0400, AK declaimed
the following in gmane.comp.python.general:
Funny that you should say that, because I thought quite a few times that
it would be really awesome if some texts in English had syntax
highlighting. O
On 09/18/2010 08:35 PM, Seebs wrote:
On 2010-09-19, AK wrote:
Funny that you should say that, because I thought quite a few times that
it would be really awesome if some texts in English had syntax
highlighting. Obviously, not Brothers Karamazov, but something like a
tutorial, or a manual, or a
On 2010-09-19, AK wrote:
> Funny that you should say that, because I thought quite a few times that
> it would be really awesome if some texts in English had syntax
> highlighting. Obviously, not Brothers Karamazov, but something like a
> tutorial, or a manual, or an online article. If key words w
On 09/18/2010 07:38 PM, Seebs wrote:
On 2010-09-18, AK wrote:
On 09/18/2010 06:56 PM, Seebs wrote:
Basically, I can handle
do x if y
pretty well, but
do x if y else z
always breaks my parser.
So in English, I might say "I'll go to the store if I have time", but
I'd rarely us
On 2010-09-18, AK wrote:
> On 09/18/2010 06:56 PM, Seebs wrote:
>> Basically, I can handle
>> do x if y
>> pretty well, but
>> do x if y else z
>> always breaks my parser.
>> So in English, I might say "I'll go to the store if I have time", but
>> I'd rarely use "I'll go to the store if
On 09/18/2010 06:56 PM, Seebs wrote:
On 2010-09-18, Steven D'Aprano wrote:
On Fri, 17 Sep 2010 16:01:54 -0400, Andreas Waldenburger wrote:
On Thu, 16 Sep 2010 16:20:33 -0400 AK wrote:
I also like this construct that works, I think, since 2.6:
code = dir[int(num):] if side == 'l' else dir[
On 2010-09-18, Steven D'Aprano wrote:
> On Fri, 17 Sep 2010 16:01:54 -0400, Andreas Waldenburger wrote:
>> On Thu, 16 Sep 2010 16:20:33 -0400 AK wrote:
>>> I also like this construct that works, I think, since 2.6:
>>> code = dir[int(num):] if side == 'l' else dir[:-1*int(num)]
>> I wonder when
On Fri, 17 Sep 2010 16:01:54 -0400, Andreas Waldenburger wrote:
> On Thu, 16 Sep 2010 16:20:33 -0400 AK wrote:
>
>> I also like this construct that works, I think, since 2.6:
>>
>> code = dir[int(num):] if side == 'l' else dir[:-1*int(num)]
>>
> I wonder when this construct will finally start
On Sep 17, 10:01 pm, Andreas Waldenburger
wrote:
> On Thu, 16 Sep 2010 16:20:33 -0400 AK wrote:
>
> > I also like this construct that works, I think, since 2.6:
>
> > code = dir[int(num):] if side == 'l' else dir[:-1*int(num)]
>
> I wonder when this construct will finally start to look good.
Us
On Thu, 16 Sep 2010 16:20:33 -0400 AK wrote:
> I also like this construct that works, I think, since 2.6:
>
> code = dir[int(num):] if side == 'l' else dir[:-1*int(num)]
>
I wonder when this construct will finally start to look good.
/W
--
INVALID? DE!
--
http://mail.python.org/mailman/li
On Sep 16, 2:47 pm, Benjamin Kaplan wrote:
> On Thu, Sep 16, 2010 at 3:35 PM, DataSmash wrote:
> > I need to create a simple utility to remove characters from either the
> > right or left side of directories.
> > This works, but there has to be a better way. I tried to use a
> > variable inside
On 09/16/2010 03:47 PM, Benjamin Kaplan wrote:
On Thu, Sep 16, 2010 at 3:35 PM, DataSmash wrote:
I need to create a simple utility to remove characters from either the
right or left side of directories.
This works, but there has to be a better way. I tried to use a
variable inside the brackets
On Thu, Sep 16, 2010 at 3:35 PM, DataSmash wrote:
> I need to create a simple utility to remove characters from either the
> right or left side of directories.
> This works, but there has to be a better way. I tried to use a
> variable inside the brackets but I can't get
> that to work. Can anyo
I need to create a simple utility to remove characters from either the
right or left side of directories.
This works, but there has to be a better way. I tried to use a
variable inside the brackets but I can't get
that to work. Can anyone think of a way to do this with less code?
Thanks!
import
75 matches
Mail list logo