Re: allow line break at operators

2011-09-04 Thread rantingrick
On Sep 4, 10:22 am, ron3200 wrote: > I think this is one of those areas where computers and people differ, > but it may also depend on the persons native language as to what works > better for them. Yes but what works better for "them" is not always a better way of doing things! People do foolis

Re: allow line break at operators

2011-09-04 Thread rantingrick
On Sep 3, 11:50 am, Stephen Hansen wrote: > Freedom is not and never has been, IMHO, a virtue or goal or even desire > in Python. Exactly! > Where it occurs, it is at best a happy coincidence, Exactly! > and even > if that happy coincidence happens often, it is not a design feature, IMHO. Ex

Re: allow line break at operators

2011-08-16 Thread Seebs
On 2011-08-16, Prasad, Ramit wrote: >What exactly is the downside to indentation as flow control? I think a lot of it is personal taste or differences in how peoples' brains work. I don't want "free form code", I don't want to write stuff that isn't correctly indented. I want a visual cue I can

Re: allow line break at operators

2011-08-16 Thread Chris Angelico
On Tue, Aug 16, 2011 at 8:26 PM, Prasad, Ramit wrote: > I am not sure why people are so stuck on braces. I figured other people would > be like me and tired of having to do things like figuring out where I missed > an end brace. > I'm one of the fans of braces, but search the list archives and

RE: allow line break at operators

2011-08-16 Thread Prasad, Ramit
>> PS: I will admit that a few of our community members can be rather >> acerbic at times. >Yeah. And the thing is... This can't possibly lead to convincing people of >your position, so presumably the purpose is that you don't want anyone who >didn't start out agreeing with you to ever come to ag

RE: allow line break at operators

2011-08-16 Thread Prasad, Ramit
>1. Indentation as flow control was a bad idea. >2. People are subconsciously aware of this. >3. There is a HUGE degree of emotional investment in defending it. > >The responses I have seen on this issue are highly emotional, full of insults, >full of blame-throwing, and utterly contrary to the

Re: allow line break at operators

2011-08-16 Thread rantingrick
On Aug 16, 1:49 am, alex23 wrote: > On Aug 16, 2:37 pm, rantingrick wrote: > > > The reading proceeds naturally from right to left. > > Well, "naturally" if you're coding in Hebrew or Japanese perhaps :) Yes :). I typo-ed that one. It was getting late when i sent that reply. I did consider posti

Re: allow line break at operators

2011-08-15 Thread alex23
On Aug 16, 2:37 pm, rantingrick wrote: > The reading proceeds naturally from right to left. Well, "naturally" if you're coding in Hebrew or Japanese perhaps :) -- http://mail.python.org/mailman/listinfo/python-list

Re: allow line break at operators

2011-08-15 Thread rantingrick
On Aug 15, 11:13 pm, alex23 wrote: > Steven D'Aprano wrote: > > I think I would be less skeptical about fluent interfaces if they were > > written more like Unix shell script pipelines instead of using attribute > > access notation: > > > foo.array_of_things | sort | map block | join ", " > > I'v

Re: allow line break at operators

2011-08-15 Thread Teemu Likonen
* 2011-08-14T01:44:05-07:00 * Chris Rebert wrote: > I've heard that Dylan is supposedly Lisp, sans parens. > http://en.wikipedia.org/wiki/Dylan_(programming_language) It has copied/derived many features from Lisps but it's not a dialect of Lisp because of the syntax and its consequences. -- http

Re: allow line break at operators

2011-08-15 Thread Seebs
On 2011-08-16, Roy Smith wrote: > In article <4e492d08$0$30003$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: >> I'm reminded of this quote from John Baez: >> "The real numbers are the dependable breadwinner of the family, the complete >> ordered field we all rely on. The complex

Re: allow line break at operators

2011-08-15 Thread Gregory Ewing
Steven D'Aprano wrote: I'm reminded of this quote from John Baez: "...But the octonions are the crazy old uncle nobody lets out of the attic: they are nonassociative." (And don't even ask about the sedenions...) Aren't they the ones that mutilate cattle and abduct people? -- Greg -- http://

Re: allow line break at operators

2011-08-15 Thread Chris Angelico
On Tue, Aug 16, 2011 at 1:34 AM, Roy Smith wrote: > In article , >  Chris Angelico wrote: > >> Or: "Blasted PHP, which >> operators have precedence between || and or?" which is easy to forget. >> >> And you're right about the details changing from language to language, >> hence the operators tabl

Re: allow line break at operators

2011-08-15 Thread Roy Smith
In article , Chris Angelico wrote: > Or: "Blasted PHP, which > operators have precedence between || and or?" which is easy to forget. > > And you're right about the details changing from language to language, > hence the operators table *for each language*. But most languages > follow fairly sa

Re: allow line break at operators

2011-08-15 Thread Roy Smith
In article <4e492d08$0$30003$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > I'm reminded of this quote from John Baez: > > "The real numbers are the dependable breadwinner of the family, the complete > ordered field we all rely on. The complex numbers are a slightly flashier > bu

Re: allow line break at operators

2011-08-15 Thread rantingrick
On Aug 15, 2:31 am, Terry Reedy wrote: > On 8/15/2011 12:28 AM, Seebs wrote: > > To repeat again: you are free to put in explicit dedent markers that > will let you re-indent code should all indents be removed. As Terry has been trying to say for a while now, use the following methods to quell y

Re: allow line break at operators

2011-08-15 Thread Seebs
On 2011-08-15, Roy Smith wrote: > Demand, no, but sometimes it's a good idea. I've been writing computer > programs for close to 40 years, and I still have no clue what most of > the order of operations is. It's just not worth investing the brain > cells to remember such trivia (especially si

Re: allow line break at operators

2011-08-15 Thread Seebs
On 2011-08-15, Steven D'Aprano wrote: > Seebs wrote: >> I tend to write stuff like >> >> foo.array_of_things.sort.map { block }.join(", ") >> >> I like this a lot more than >> array = foo.array_of_things >> sorted_array = array.sort() >> mapped_array = [block(x) for x in sorted_array] >> ", ".jo

Re: allow line break at operators

2011-08-15 Thread Chris Angelico
On Mon, Aug 15, 2011 at 3:28 PM, Steven D'Aprano wrote: > And of course, once you start using floating point numbers, you can't assume > commutativity: > 0.1 + 0.7 + 0.3 == 0.3 + 0.7 + 0.1 > False > This isn't because programming languages fail to follow mathematics; it's because floating po

Re: allow line break at operators

2011-08-15 Thread Steven D'Aprano
Roy Smith wrote: > Computer programming languages follow math conventions only in the most > vague ways.  For example, standard math usage dictates that addition is > commutative.  While this is true for adding integers, it's certainly not > true for adding strings (in any language which supports

Re: allow line break at operators

2011-08-15 Thread Chris Angelico
On Mon, Aug 15, 2011 at 2:41 PM, Roy Smith wrote: > Demand, no, but sometimes it's a good idea.  I've been writing computer > programs for close to 40 years, and I still have no clue what most of > the order of operations is.  It's just not worth investing the brain > cells to remember such trivia

Re: allow line break at operators

2011-08-15 Thread Roy Smith
In article , Chris Angelico wrote: > Python uses the + and - symbols to mean addition > and subtraction for good reason. Let's not alienate the mathematical > mind by violating this rule. Computer programming languages follow math conventions only in the most vague ways. For example, standard

Re: allow line break at operators

2011-08-15 Thread Steven D'Aprano
Seebs wrote: > I tend to write stuff like > > foo.array_of_things.sort.map { block }.join(", ") > > I like this a lot more than > array = foo.array_of_things > sorted_array = array.sort() > mapped_array = [block(x) for x in sorted_array] > ", ".join(mapped_array) If you insist on a one-liner fo

Re: allow line break at operators

2011-08-15 Thread Johann Hibschman
Chris Angelico writes: > Why is left-to-right inherently more logical than > multiplication-before-addition? Why is it more logical than > right-to-left? And why is changing people's expectations more logical > than fulfilling them? Python uses the + and - symbols to mean addition > and subtracti

Re: allow line break at operators

2011-08-15 Thread Tim Chase
On 08/14/2011 11:28 PM, Seebs wrote: I tend to write stuff like foo.array_of_things.sort.map { block }.join(", ") I like this a lot more than array = foo.array_of_things sorted_array = array.sort() mapped_array = [block(x) for x in sorted_array] ", ".join

Re: allow line break at operators

2011-08-15 Thread Paul Woolcock
On Aug 14, 2011 3:24 PM, "Seebs" wrote: ... > > I'm not impressed by arguments based on "but if I do something stupid, like > > select text with my eyes closed and reindent it without looking, I expect > > the compiler to save my bacon". In my opinion, it's not the compiler's job > > to protect yo

Re: allow line break at operators

2011-08-15 Thread Chris Angelico
On Mon, Aug 15, 2011 at 5:28 AM, Seebs wrote: > Character stream:  tab tab tab "foo" newline tab "bar".  This is, as you > say, *usually* two dedents, but it could be one. I see your point, though I cannot imagine anyone who would use "tab tab" as an indent level. But if you go from 16 spaces dow

Re: allow line break at operators

2011-08-15 Thread Terry Reedy
On 8/15/2011 12:28 AM, Seebs wrote: To repeat again: you are free to put in explicit dedent markers that will let you re-indent code should all indents be removed. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: allow line break at operators

2011-08-14 Thread Tim Roberts
Steven D'Aprano wrote: > >The only exception I can think of is *very* early Fortran, and that rightly >is considered a mistake. Fortran 77 used to treat whitespace as always >optional, so that in Python terms this: > >forxinrange(42) > >would be parsed as this: > >for x in range(42) Absolutely tr

Re: allow line break at operators

2011-08-14 Thread Seebs
On 2011-08-15, Chris Rebert wrote: > On Sun, Aug 14, 2011 at 6:54 PM, Steven D'Aprano > wrote: >> As a rule, chaining method calls risks violating the Law of Demeter. Just >> sayin'. > Not in the specific case of fluent interfaces[1] though, which could > have been what Seebach had in mind. They

Re: allow line break at operators

2011-08-14 Thread Seebs
On 2011-08-15, Steven D'Aprano wrote: >> Interesting! I tend to really like the ability to chain methods, >> depending >> on context. I find the side-effect/expression mix pretty normal, so I'm >> used to it. > As a rule, chaining method calls risks violating the Law of Demeter. Just > sayin'.

Re: allow line break at operators

2011-08-14 Thread Chris Rebert
On Sun, Aug 14, 2011 at 6:54 PM, Steven D'Aprano wrote: > Seebs wrote: >> Interesting!  I tend to really like the ability to chain methods, >> depending >> on context.  I find the side-effect/expression mix pretty normal, so I'm >> used to it. > > As a rule, chaining method calls risks violating

Re: allow line break at operators

2011-08-14 Thread Steven D'Aprano
Seebs wrote: > On 2011-08-14, Steven D'Aprano > wrote: >> The way I see it, if something operates by side-effect, then it has no >> business being treated as an expression. Which I later withdrew. > Interesting! I tend to really like the ability to chain methods, > depending > on context. I

Re: allow line break at operators

2011-08-14 Thread Chris Angelico
On Sun, Aug 14, 2011 at 11:46 PM, Roy Smith wrote: > In article , >  Dave Angel wrote: > >> The thing that confuses people is that not only is the part up to and >> through the domain name is case-insensitive, but that simple pages on >> Windows become case-insensitive for the remainder simply be

Re: allow line break at operators

2011-08-14 Thread Roy Smith
In article , Dave Angel wrote: > > URLs are most certainly not case insensitive. Parts of them may be > > (i.e. the scheme and host parts), but not the stuff after the hostname. > > > The thing that confuses people is that not only is the part up to and > through the domain name is case-insens

Re: Re: allow line break at operators

2011-08-14 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Roy Smith wrote: In article<4e47db26$0$30002$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: Er, most URLs are case insensitive, at least the most common ones, including HTTP and HTTPS. So I don't quite see why you think this was a Whoops. URLs are mos

Re: allow line break at operators

2011-08-14 Thread Chris Angelico
On Sun, Aug 14, 2011 at 10:27 AM, Ben Finney wrote: > The house lights need to be controlled by someone who knows when the > movie's end signal should be sent. What is our ending signal if we're > watching it from media in our home, and no-one in the house knows when > the movie ends? > If you're

Re: allow line break at operators

2011-08-14 Thread Seebs
On 2011-08-14, Teemu Likonen wrote: > I understand that Python philosophy does not value freedom of expression > that much. It values a general Pythonic rule which must obeyed and is > called "readability". Other languages give too little or too much > freedom. :-) There is an interesting tradeof

Re: allow line break at operators

2011-08-14 Thread Seebs
On 2011-08-14, Steven D'Aprano wrote: > Seebs wrote: >> "Destroy data" is a sort of fungible concept. I was reading a comic book >> recently and it contained a URL for a poem which had been parodied. The >> URL had been hand-lettered... in block capitals. The actual URL had >> exactly one upper

Re: allow line break at operators

2011-08-14 Thread Seebs
On 2011-08-14, Chris Angelico wrote: > Yes. Not everything's an expression; a block of code is not an > expression that returns a code object, and variable assignment is a > statement. Some day, I'd like to play around with a language where > everything's an expression and yet it doesn't look like

Re: allow line break at operators

2011-08-14 Thread Steven D'Aprano
Chris Angelico wrote: > On Sun, Aug 14, 2011 at 3:26 PM, Steven D'Aprano > wrote: >> Yes, print as a statement was a mistake. But assignment as a statement, >> not so much. Assignment as an expression in languages that have it tends >> to be associated with frequent errors. >> >> The way I see it

Re: allow line break at operators

2011-08-14 Thread Roy Smith
In article <4e47db26$0$30002$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > Er, most URLs are case insensitive, at least the most common ones, including > HTTP and HTTPS. So I don't quite see why you think this was a Whoops. URLs are most certainly not case insensitive. Parts of

Re: allow line break at operators

2011-08-14 Thread Chris Angelico
On Sun, Aug 14, 2011 at 3:26 PM, Steven D'Aprano wrote: > Yes, print as a statement was a mistake. But assignment as a statement, not > so much. Assignment as an expression in languages that have it tends to be > associated with frequent errors. > > The way I see it, if something operates by side-

Re: allow line break at operators

2011-08-14 Thread Steven D'Aprano
Seebs wrote: > "Destroy data" is a sort of fungible concept. I was reading a comic book > recently and it contained a URL for a poem which had been parodied. The > URL had been hand-lettered... in block capitals. The actual URL had > exactly one upper case letter in it. > > Whoops. Er, most U

Re: allow line break at operators

2011-08-14 Thread Ethan Furman
Ben Finney wrote: Chris Angelico writes: On Sun, Aug 14, 2011 at 8:10 AM, Steven D'Aprano wrote: Do you get worried by books if the last page doesn't include the phrase "The End"? These days, many movies include an extra clip following the credits. When the clip finishes, and the screen go

Re: allow line break at operators

2011-08-14 Thread Teemu Likonen
* 2011-08-14T09:34:26+01:00 * Chris Angelico wrote: > Some day, I'd like to play around with a language where everything's > an expression and yet it doesn't look like LISP - just for the fun of > it. It probably won't be any more useful for real world coding, but > it'd be fun to tinker with. Of

Re: allow line break at operators

2011-08-14 Thread Ben Finney
Chris Angelico writes: > On Sun, Aug 14, 2011 at 8:10 AM, Steven D'Aprano > wrote: > > Do you get worried by books if the last page doesn't include the > > phrase "The End"? These days, many movies include an extra clip > > following the credits. When the clip finishes, and the screen goes > >

Re: allow line break at operators

2011-08-14 Thread Ben Finney
Seebs writes: > I was utterly dumbfounded when I found out that "print" in Python is a > kind of statement, not a function or something comparable. (This seems > to have changed recentlyish.) It has long been recognised as a wart, but it required waiting for an opportunity for breaking backward

Re: allow line break at operators

2011-08-14 Thread Chris Rebert
On Sun, Aug 14, 2011 at 1:34 AM, Chris Angelico wrote: > Yes. Not everything's an expression; a block of code is not an > expression that returns a code object, and variable assignment is a > statement. Some day, I'd like to play around with a language where > everything's an expression and yet i

Re: allow line break at operators

2011-08-14 Thread Chris Angelico
On Sun, Aug 14, 2011 at 8:10 AM, Steven D'Aprano wrote: > Do you get worried by books if the last page doesn't include the phrase "The > End"? These days, many movies include an extra clip following the credits. > When the clip finishes, and the screen goes dark, how long do you sit > waiting befo

Re: allow line break at operators

2011-08-14 Thread Seebs
On 2011-08-14, Steven D'Aprano wrote: > Seebs wrote: >> I guess... The parser is explicitly pushing those tokens, but I can't >> *SEE* those tokens. If I am looking at the end of a really long >> thing, and I see: >> >> blah >> blah >> >> I only know what's happe

Re: allow line break at operators

2011-08-14 Thread Steven D'Aprano
Seebs wrote: > I guess... The parser is explicitly pushing those tokens, but I can't > *SEE* those tokens. If I am looking at the end of a really long > thing, and I see: > > blah > blah > > I only know what's happening if I have absolute confidence that the > in

Re: allow line break at operators

2011-08-13 Thread rantingrick
On Aug 12, 4:06 pm, Seebs wrote: > On 2011-08-12, Chris Angelico wrote: > > > Why is left-to-right inherently more logical than > > multiplication-before-addition? > > I'd say it's certainly "more Pythonic in a vacuum". > Multiplication-before-addition, and all the related rules, require > you to

Re: allow line break at operators

2011-08-13 Thread rantingrick
On Aug 12, 7:39 pm, Seebs wrote: > Consider the hypothetical array syntax: > >         a = [ >             1, >             2 >         b = [ >             3, >             4 > > This *bugs* me.  It's perfectly legible, and if you define it that way, it's > unambiguous and everything, but... It b

Re: allow line break at operators

2011-08-13 Thread rantingrick
On Aug 12, 7:39 pm, Seebs wrote: > I was overjoyed when I saw that Ruby would let me write 1_048_576. I'll have to admit that Ruby has a few very interesting ideas, this being one of them. We all know how impossible it can be to eyeball parse a very long number like this. Having the interpretor

Re: allow line break at operators

2011-08-13 Thread rantingrick
On Aug 12, 7:39 pm, Seebs wrote: > Well, that's the thing. > > In a case like: > >         if foo: >                 if bar: >                         blah >         blah > > I notice that *NOTHING* lines up with "if bar:".  And that affects me > about the way unmatched brackets do. For me, i be

Re: allow line break at operators

2011-08-13 Thread rantingrick
On Aug 12, 5:03 pm, Steven D'Aprano wrote: > Responding to Rick's standard {EDIT} posts > is like wrestling with a {EDIT} > [...] > Save yourself a lot of aggravation and kill-file him now. Kindly allow Walter E. Kurtz to shine some light on this situation: """ Pig after pig, cow after cow, vil

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-13, Ben Finney wrote: > Seebs writes: >> What's being pushed into the stream to indicate that the first outdent >> is two outdents and the second is one? > See http://docs.python.org/reference/lexical_analysis.html> for a > comprehensive discussion of the lexing done on Python source.

Re: allow line break at operators

2011-08-12 Thread Gregory Ewing
Chris Angelico wrote: But both of these violate XKCD 859. For the benefit of all those who just went off to read that strip, here's something to help you unwind: ) There, you can relax now. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: allow line break at operators

2011-08-12 Thread Ben Finney
Seebs writes: > What's being pushed into the stream to indicate that the first outdent > is two outdents and the second is one? See http://docs.python.org/reference/lexical_analysis.html> for a comprehensive discussion of the lexing done on Python source. To examine the resulting code objects,

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-13, Terry Reedy wrote: > I have been indenting code neatly for at least 32 years whenever the > language I used allowed it. Just over 14 years ago, when Python was an > obscure little known or used languge, I adopted it *because* it dropped > all the redundant bracket noise and looke

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, Steven D'Aprano wrote: > Seebs wrote: >> You know, that's why the outdents-without-symbols bug me; I have a >> thing with a colon on it introducing something, and then there's nothing >> ending it. > But there is something ending it: a change in indentation level. Hmm. Okay, here

Re: allow line break at operators

2011-08-12 Thread Terry Reedy
On 8/12/2011 6:14 PM, Seebs wrote: I am responding to your whole line of posts. I have been indenting code neatly for at least 32 years whenever the language I used allowed it. Just over 14 years ago, when Python was an obscure little known or used languge, I adopted it *because* it dropped a

Re: allow line break at operators

2011-08-12 Thread Tim Chase
On 08/12/2011 05:50 PM, Chris Angelico wrote: You can write Perl code in the shape of a camel. Can you do that in Python? Okay. Open challenge to anyone. Write a Python script that outputs "Just another Python hacker" or some such message, and is shaped in some way appropriately. And no fair doi

Re: allow line break at operators

2011-08-12 Thread Ben Finney
Chris Angelico writes: > On Fri, Aug 12, 2011 at 11:39 PM, Steven D'Aprano > wrote: > > ask most writers or artists and they would say *of course* > > whitespace matters. > > You can write Perl code in the shape of a camel. Can you do that in > Python? I'm glad to be using a language where that

Re: allow line break at operators

2011-08-12 Thread Chris Angelico
On Fri, Aug 12, 2011 at 11:39 PM, Steven D'Aprano wrote: > ask most writers or artists and they would say *of course* > whitespace matters. You can write Perl code in the shape of a camel. Can you do that in Python? Okay. Open challenge to anyone. Write a Python script that outputs "Just another

Re: allow line break at operators

2011-08-12 Thread Steven D'Aprano
Seebs wrote: > You know, that's why the outdents-without-symbols bug me; I have a > thing with a colon on it introducing something, and then there's nothing > ending it. But there is something ending it: a change in indentation level. Python's parser explicitly pushes INDENT and OUTDENT tokens i

Re: allow line break at operators

2011-08-12 Thread Ben Finney
Seebs writes: > I sometimes enjoy trying to extract information from people like that, > but I will respect the preferences of the actually-helpful people and > drop that line of inquiry. :) Much appreciated, thank you :-) -- \ “It is well to remember that the entire universe, with o

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, Steven D'Aprano wrote: > Please don't feed the troll. Responding to Rick's standard obnoxious posts > is like wrestling with a pig -- you get tired and filthy, you never > accomplish anything useful, and after a while, you realise that the pig is > enjoying it. Save yourself a lot o

Re: allow line break at operators

2011-08-12 Thread Ben Finney
Seebs writes: > On 2011-08-12, rantingrick wrote: > > What is with you guys and this need to have your hand held to read > > code. > > Good question! Great to see that the helpful and welcoming community > is living up to its reputation. Please be aware that the particular person to whom you'r

Re: allow line break at operators

2011-08-12 Thread Steven D'Aprano
Seebs wrote: > On 2011-08-12, rantingrick wrote: >> What is with you guys and this need to have your hand held to read >> code. > > Good question! Great to see that the helpful and welcoming community > is living up to its reputation. Please don't feed the troll. Responding to Rick's standard

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, Chris Angelico wrote: > On Fri, Aug 12, 2011 at 5:33 PM, Seebs wrote: >> I've seen people in C do stuff like: >> ? ? ? ?for (i = 0; i < N; ++i); >> ? ? ? ? ? ? ? ?a[i] = 0; >> This is clearly a case where indentation matches intent, but doesn't match >> functionality, because C a

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, rantingrick wrote: > On Aug 12, 11:33?am, Seebs wrote: >> My brain has quirks. ?Some people call them defects, some don't, but it >> really doesn't matter; there are things about which my brain is just plain >> unreliable and I rely moderately heavily on extra visual cues to reduce

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, Chris Angelico wrote: > Why is left-to-right inherently more logical than > multiplication-before-addition? I'd say it's certainly "more Pythonic in a vacuum". Multiplication-before-addition, and all the related rules, require you to know a lot of special rules which are not visibl

Re: allow line break at operators

2011-08-12 Thread Chris Kaynor
On Fri, Aug 12, 2011 at 1:09 PM, Chris Angelico wrote: > On Fri, Aug 12, 2011 at 6:57 PM, rantingrick > wrote: > > I'm glad you brought this up! How about this instead: > > > >a = x + y * z > > > > ...where the calculation is NOT subject to operator precedence? I > > always hated using paren

Re: allow line break at operators

2011-08-12 Thread Ethan Furman
Chris Angelico wrote: Incidentally, in the original expression, it would be slightly more sane to write it as: a = x + y) * z borrowing from the musical concept that a repeat sign with no corresponding begin-repeat means to repeat from the beginning. But both of these violate XKCD 859. Argh!

Re: allow line break at operators

2011-08-12 Thread Chris Angelico
On Fri, Aug 12, 2011 at 6:57 PM, rantingrick wrote: > I'm glad you brought this up! How about this instead: > >    a = x + y * z > > ...where the calculation is NOT subject to operator precedence? I > always hated using parenthesis in mathematical calculations. All math > should resolve in a linea

Re: allow line break at operators

2011-08-12 Thread Chris Angelico
On Fri, Aug 12, 2011 at 5:33 PM, Seebs wrote: > I've seen people in C do stuff like: > >        for (i = 0; i < N; ++i); >                a[i] = 0; > > This is clearly a case where indentation matches intent, but doesn't match > functionality, because C allows indentation to not-match functionalit

Re: allow line break at operators

2011-08-12 Thread Chris Angelico
On Fri, Aug 12, 2011 at 4:33 PM, rantingrick wrote: > On Aug 12, 2:20 am, Chris Angelico wrote: > >> Pike is very [snip] >> Pike's purpose is [snip] >> you go to Pike[snip] >> >> I hope I make myself clear, Josephine? > > The only thing that is clear to me is that you have a hidden agenda to > in

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, Chris Rebert wrote: > One argument I've heard from braces fans is that sometimes they want > their own structure, which does not match the actual block structure. EWW! > Example: > > FILE* f = fopen(...); > // do stuff with f > // at this indent level > fclose(f); > // bac

Re: allow line break at operators

2011-08-12 Thread rantingrick
On Aug 12, 11:33 am, Seebs wrote: > > My brain has quirks.  Some people call them defects, some don't, but it > really doesn't matter; there are things about which my brain is just plain > unreliable and I rely moderately heavily on extra visual cues to reduce > the frequency with which I get thin

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, rantingrick wrote: > What is with you guys and this need to have your hand held to read > code. Good question! Great to see that the helpful and welcoming community is living up to its reputation. My brain has quirks. Some people call them defects, some don't, but it really does

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, Chris Angelico wrote: > On Fri, Aug 12, 2011 at 7:34 AM, Seebs wrote: >> If Python with braces wouldn't be Python at all, why on earth does the >> language even exist? > Every language has its philosophy. Yes. > Etcetera. These are the philosophical decisions made by GvR and the

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, Ben Finney wrote: > Seebs writes: >> Question for y'all: >> >> Has anyone here ever ACTUALLY encountered a case where braces -- not >> indentation -- did not match intent in a C-like language? I'm talking >> only about cases where braces are *actually present*. > What a strange l

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, Ben Finney wrote: > Seebs writes: >> I am pretty sure Python is a pretty nice language. However, the >> indentation thing has screwed me a few times. Furthermore, I know >> people who like Python a great deal and acknowledge, without much >> difficulty, that the indentation thing h

Re: allow line break at operators

2011-08-12 Thread Chris Rebert
On Fri, Aug 12, 2011 at 3:39 AM, Ben Finney wrote: > Seebs writes: > >> Question for y'all: >> >> Has anyone here ever ACTUALLY encountered a case where braces -- not >> indentation -- did not match intent in a C-like language?  I'm talking >> only about cases where braces are *actually present*.

Re: allow line break at operators

2011-08-12 Thread rantingrick
On Aug 12, 2:20 am, Chris Angelico wrote: > Pike is very [snip] > Pike's purpose is [snip] > you go to Pike[snip] > > I hope I make myself clear, Josephine? The only thing that is clear to me is that you have a hidden agenda to incorporate pike's functionality into Python -- and this is not the

Re: allow line break at operators

2011-08-12 Thread rantingrick
On Aug 12, 1:34 am, Seebs wrote: > > And part of this really is personal taste.  I *LIKE* having a matching outdent > for everything.  I like to look at code and see >         blah >                 blah >                         blah >                 blah >         blah > > because then I know i

Re: allow line break at operators

2011-08-12 Thread Thomas Rachel
Am 12.08.2011 03:40 schrieb Steven D'Aprano: The only exception I can think of is *very* early Fortran, and that rightly is considered a mistake. ATARI 800XL. Built-in BASIC, acknowledging every command with "READY". Going over it with the cursor results in "ERROR- 6", meaning "no READ witho

Re: allow line break at operators

2011-08-12 Thread Neil Cerutti
On 2011-08-12, Steven D'Aprano wrote: > Chris Angelico wrote: > >> Incidentally, I will happily argue the >> benefits of Python's significant whitespace, even though I disagree >> with it; there are quite a few. > > Please be careful about conflating significant indentation with significant > whi

Re: allow line break at operators

2011-08-12 Thread Ben Finney
Steven D'Aprano writes: > Ben Finney wrote: > > > Likewise, “end of line as end of statement” has caused me and many > > others problems. > > I don't understand this. Can you give an example? Many times I have split a line expecting that some bracketing syntax will cause the statement to continu

Re: allow line break at operators

2011-08-12 Thread Steven D'Aprano
Ben Finney wrote: > Likewise, “end of line as end of statement” has caused me and many > others problems. I don't understand this. Can you give an example? Do you mean, "Sometimes I want more code in a single statement than will comfortably fit in a single line"? -- Steven -- http://mail.p

Re: allow line break at operators

2011-08-12 Thread Ben Finney
Seebs writes: > Question for y'all: > > Has anyone here ever ACTUALLY encountered a case where braces -- not > indentation -- did not match intent in a C-like language? I'm talking > only about cases where braces are *actually present*. What a strange limitation. Why are you not comparing apple

Re: allow line break at operators

2011-08-12 Thread Yingjie Lan
From: Vito 'ZeD' De Tullio :umm... besides "notepad" pretty much any other serious "programmer editor" :program try to do its best to deal with line wrap: the minimal I found is :the wrapped line is "indented" at the same level of the flow, but I found :edi

Re: allow line break at operators

2011-08-12 Thread Yingjie Lan
> :The trouble of dealing with long lines can be avoided by a smart > :editor. It's called line wrap. > > Yeah, usually they just wrap it pretty arbitrarily, > and you don't have any control, isn't it? :umm... besides "notepad" pretty much any other serious "programmer editor" :program try to d

Re: allow line break at operators

2011-08-12 Thread Ben Finney
Seebs writes: > On 2011-08-11, Ben Finney wrote: > > You're welcome to attempt to demonstrate the superiority of some > > other Python-with-braces, but it will (a) be un-Pythonic, and (b) be > > unlikely to gain the efforts of people who don't think what you're > > addressing is a problem. > > I

Re: allow line break at operators

2011-08-12 Thread Chris Angelico
On Fri, Aug 12, 2011 at 7:34 AM, Seebs wrote: > If Python with braces wouldn't be Python at all, why on earth does the > language even exist? Every language has its philosophy. Python, as conceived by Guido van Rossum, is a language which (guys, correct me where I'm wrong please!): * Eschews unn

Re: allow line break at operators

2011-08-12 Thread Chris Angelico
On Fri, Aug 12, 2011 at 2:40 AM, Steven D'Aprano wrote: > Please be careful about conflating significant indentation with significant > whitespace. Many languages have significant whitespace: > > foo bar > > is rarely the same thing as > > foobar > > but is the same as > > foo           bar > > Py

Re: allow line break at operators

2011-08-11 Thread Seebs
Before I get to the rest of this: Thinking it through, I've been unreasonable and grumpy here, and I'm trying to figure this out a bit more. A general observation: There's no real data here, so far as I can tell. There is no pair of languages which are exactly identical except for whether they u

Re: allow line break at operators

2011-08-11 Thread Steven D'Aprano
Chris Angelico wrote: > Incidentally, I will happily argue the > benefits of Python's significant whitespace, even though I disagree > with it; there are quite a few. Please be careful about conflating significant indentation with significant whitespace. Many languages have significant whitespac

  1   2   >