Re: A desperate lunge for on-topic-ness

2012-10-23 Thread Steven D'Aprano
On Tue, 23 Oct 2012 17:24:34 -0600, Ian Kelly wrote: > On Tue, Oct 23, 2012 at 4:34 PM, Steven D'Aprano > wrote: >> On Tue, 23 Oct 2012 10:50:11 -0600, Ian Kelly wrote: >> if someone is foolish enough to use the from xyz import * notation... >>> >>> It's already a

Re: A desperate lunge for on-topic-ness

2012-10-23 Thread Ian Kelly
On Tue, Oct 23, 2012 at 4:34 PM, Steven D'Aprano wrote: > On Tue, 23 Oct 2012 10:50:11 -0600, Ian Kelly wrote: > >>> if someone is foolish enough to use the >>> >>> from xyz import * >>> >>> notation... >> >> It's already a SyntaxError to use a wildcard import anywhere other than >> the mo

Re: A desperate lunge for on-topic-ness

2012-10-23 Thread Steven D'Aprano
On Tue, 23 Oct 2012 10:50:11 -0600, Ian Kelly wrote: >> if someone is foolish enough to use the >> >> from xyz import * >> >> notation... > > It's already a SyntaxError to use a wildcard import anywhere other than > the module level, so its use can only affect global variables. In Python

Re: A desperate lunge for on-topic-ness

2012-10-23 Thread Ian Kelly
On Mon, Oct 22, 2012 at 7:39 PM, Dennis Lee Bieber wrote: > On Mon, 22 Oct 2012 16:02:34 -0600, Ian Kelly > declaimed the following in gmane.comp.python.general: > >> On my wishlist for Python is a big, fat SyntaxError for any variable >> that could be interpreted as either local or nonlocal and

Re: A desperate lunge for on-topic-ness

2012-10-23 Thread Joshua Landau
On 23/10/2012, Dennis Lee Bieber wrote: > On Mon, 22 Oct 2012 16:02:34 -0600, Ian Kelly > declaimed the following in gmane.comp.python.general: > >> On my wishlist for Python is a big, fat SyntaxError for any variable >> that could be interpreted as either local or nonlocal and is not >> explicit

Re: A desperate lunge for on-topic-ness

2012-10-22 Thread Ian Kelly
On Mon, Oct 22, 2012 at 1:03 AM, Chris Angelico wrote: > Python's system "just works" most of > the time, but can introduce yet another trap for the unsuspecting > newbie who doesn't understand the difference between rebinding and > mutating; I've not looked into multiple levels of closures but I

RE: A desperate lunge for on-topic-ness

2012-10-22 Thread Prasad, Ramit
Roy Smith wrote: > Pet peeve of the day... > > Why do you have to write: > > global foo > foo = 4 > > when > > global foo = 4 > > would have been so much easier? To make it more annoying for people who use globals, duh. :) Ramit Prasad This email is confidential and subject to important dis

Re: A desperate lunge for on-topic-ness

2012-10-22 Thread Roy Smith
In article <5084e819$0$29897$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Mon, 22 Oct 2012 07:22:18 +1100, Chris Angelico wrote: > > > On Mon, Oct 22, 2012 at 6:11 AM, Steven D'Aprano > > wrote: > > >>> Ahh. I totally didn't see that, I'm way too used to reading past > >>>

Re: A desperate lunge for on-topic-ness

2012-10-22 Thread Chris Angelico
On Mon, Oct 22, 2012 at 5:30 PM, Steven D'Aprano wrote: > For languages without static types, what other reasons for declaring > variables are there? The main one is scope nesting. Compare a few different languages. Python: If you don't declare, it's global if you don't rebind it, but local if y

Re: A desperate lunge for on-topic-ness

2012-10-21 Thread Steven D'Aprano
On Mon, 22 Oct 2012 07:22:18 +1100, Chris Angelico wrote: > On Mon, Oct 22, 2012 at 6:11 AM, Steven D'Aprano > wrote: >>> Ahh. I totally didn't see that, I'm way too used to reading past >>> typos. >> >> As a programmer, doesn't that screw up your debugging ability? > > Reading-past-typos appli

Re: A desperate lunge for on-topic-ness

2012-10-21 Thread Walter Hurry
On Sat, 20 Oct 2012 16:37:23 -0400, Roy Smith wrote: > sys.stderr.write("Error: Can't find the file 'settings.py' > in the directory containing %r.\nYou'll have to run django-profile.py, > passing it your settings module.\n(If the file settings.py does indeed > exist, it's causing an

Re: A desperate lunge for on-topic-ness

2012-10-21 Thread Joshua Landau
On 21 October 2012 21:38, Chris Angelico wrote: > On Mon, Oct 22, 2012 at 7:19 AM, Roy Smith wrote: > > Of course, the same can happen in Python. I could do: > > > > foo = "default value" > > if blah == 47: > >fooo = "some other value" > > print foo > > > > No syntax error, no NameError, ju

Re: A desperate lunge for on-topic-ness

2012-10-21 Thread Chris Angelico
On Mon, Oct 22, 2012 at 7:19 AM, Roy Smith wrote: > Of course, the same can happen in Python. I could do: > > foo = "default value" > if blah == 47: >fooo = "some other value" > print foo > > No syntax error, no NameError, just the wrong thing printing. Yeah, that's the worst kind of bug. No

Re: A desperate lunge for on-topic-ness

2012-10-21 Thread Chris Angelico
On Mon, Oct 22, 2012 at 6:11 AM, Steven D'Aprano wrote: > On Sun, 21 Oct 2012 22:43:07 +1100, Chris Angelico wrote: > >> On Sun, Oct 21, 2012 at 9:00 PM, Steven D'Aprano >> wrote: >>> Er, no. Note spelling of "source code" vs "souce code". Hence the grin. >> >> Ahh. I totally didn't see that, I'm

Re: A desperate lunge for on-topic-ness

2012-10-21 Thread Roy Smith
In article , Grant Edwards wrote: > On 2012-10-21, Steven D'Aprano wrote: > > On Sun, 21 Oct 2012 22:43:07 +1100, Chris Angelico wrote: > > > >> On Sun, Oct 21, 2012 at 9:00 PM, Steven D'Aprano > >> wrote: > >>> Er, no. Note spelling of "source code" vs "souce code". Hence the grin. > >> > >>

Re: A desperate lunge for on-topic-ness

2012-10-21 Thread Grant Edwards
On 2012-10-21, Steven D'Aprano wrote: > On Sun, 21 Oct 2012 22:43:07 +1100, Chris Angelico wrote: > >> On Sun, Oct 21, 2012 at 9:00 PM, Steven D'Aprano >> wrote: >>> Er, no. Note spelling of "source code" vs "souce code". Hence the grin. >> >> Ahh. I totally didn't see that, I'm way too used to

Re: A desperate lunge for on-topic-ness

2012-10-21 Thread Steven D'Aprano
On Sun, 21 Oct 2012 22:43:07 +1100, Chris Angelico wrote: > On Sun, Oct 21, 2012 at 9:00 PM, Steven D'Aprano > wrote: >> Er, no. Note spelling of "source code" vs "souce code". Hence the grin. > > Ahh. I totally didn't see that, I'm way too used to reading past typos. As a programmer, doesn't t

Re: A desperate lunge for on-topic-ness

2012-10-21 Thread DJC
On 20/10/12 15:18, Grant Edwards wrote: On 2012-10-20, Dennis Lee Bieber wrote: Strangely, we've gone from 80-character fixed width displays to who-knows-what (if I drop my font size I can probably get nearly 200 characters across in full-screen mode)... But at the same time w

Re: A desperate lunge for on-topic-ness

2012-10-21 Thread Chris Angelico
On Sun, Oct 21, 2012 at 9:00 PM, Steven D'Aprano wrote: > Er, no. Note spelling of "source code" vs "souce code". Hence the grin. Ahh. I totally didn't see that, I'm way too used to reading past typos. Sure. Printing out *source* code, that's altogether different. Me, though, I don't print anyth

Re: A desperate lunge for on-topic-ness

2012-10-21 Thread Gene Heskett
On Sunday 21 October 2012 07:02:26 Steven D'Aprano did opine: > On Sat, 20 Oct 2012 14:18:47 +, Grant Edwards wrote: > > On 2012-10-20, Dennis Lee Bieber wrote: > >>Strangely, we've gone from 80-character fixed width displays to > >> > >> who-knows-what (if I drop my font size I can prob

Re: printing (was: A desperate lunge for on-topic-ness)

2012-10-21 Thread Tim Chase
On 10/21/12 05:00, Steven D'Aprano wrote: > I seriously do print out source code. When I'm having trouble > seeing how the parts of a module fit together, reading print-outs > is a good way around the problem. I don't print my personal code--both in light of the fact that I know it much more intim

Re: A desperate lunge for on-topic-ness

2012-10-21 Thread Steven D'Aprano
On Sun, 21 Oct 2012 20:20:41 +1100, Chris Angelico wrote: > On Sun, Oct 21, 2012 at 7:07 PM, Steven D'Aprano > wrote: >> On Sat, 20 Oct 2012 14:18:47 +, Grant Edwards wrote: >>> True, but nobody prints source code out on paper do they? >> >> I do. >> >> There's nothing better than spreading o

Re: A desperate lunge for on-topic-ness

2012-10-21 Thread Chris Angelico
On Sun, Oct 21, 2012 at 7:07 PM, Steven D'Aprano wrote: > On Sat, 20 Oct 2012 14:18:47 +, Grant Edwards wrote: >> True, but nobody prints source code out on paper do they? > > I do. > > There's nothing better than spreading out a dozen sheets of source code > over a table to get a good, high-l

Re: A desperate lunge for on-topic-ness

2012-10-21 Thread Steven D'Aprano
On Sat, 20 Oct 2012 14:18:47 +, Grant Edwards wrote: > On 2012-10-20, Dennis Lee Bieber wrote: > >> Strangely, we've gone from 80-character fixed width displays to >> who-knows-what (if I drop my font size I can probably get nearly 200 >> characters across in full-screen mode)... >> >>

Re: A desperate lunge for on-topic-ness

2012-10-20 Thread Roy Smith
In article <5081d0c3$0$30003$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > Some code might be more conveniently written as a single long line. But I > would argue that nearly never is code more easily *read* as a single long > line, and since code is read much more than it is w

Re: A desperate lunge for on-topic-ness

2012-10-20 Thread Walter Hurry
On Sat, 20 Oct 2012 14:18:47 +, Grant Edwards wrote: > True, but nobody prints source code out on paper do they? > > Seriously -- I can't remember the last time I printed souce code... I remember my first IT job - COBOL programming in the early 80's. The rule was that every time we delivere

Re: A desperate lunge for on-topic-ness

2012-10-20 Thread David Robinow
On Sat, Oct 20, 2012 at 3:10 PM, Dennis Lee Bieber wrote: > On Sat, 20 Oct 2012 14:18:47 + (UTC), Grant Edwards > declaimed the following in > gmane.comp.python.general: > >> >> True, but nobody prints source code out on paper do they? >> >> Seriously -- I can't remember the last time I print

Re: A desperate lunge for on-topic-ness

2012-10-20 Thread Joshua Landau
On 20 October 2012 15:18, Grant Edwards wrote: > On 2012-10-20, Dennis Lee Bieber wrote: > > > Strangely, we've gone from 80-character fixed width displays to > > who-knows-what (if I drop my font size I can probably get nearly 200 > > characters across in full-screen mode)... > > > >

Re: A desperate lunge for on-topic-ness

2012-10-20 Thread Grant Edwards
On 2012-10-20, Dennis Lee Bieber wrote: > Strangely, we've gone from 80-character fixed width displays to > who-knows-what (if I drop my font size I can probably get nearly 200 > characters across in full-screen mode)... > > But at the same time we've gone from 132-character line-prin

Re: A desperate lunge for on-topic-ness

2012-10-20 Thread rusi
On Oct 20, 8:27 am, Tim Chase wrote: > On 10/19/12 17:14, Steven D'Aprano wrote: > > > Code never *needs* to be long, because it can always be shortened. > > I advocate one bit per line: > > 1 > 0 > 1 > 0 > 0 > 1 > 0 > 1 > 1 > 0 > 0 > 1 > 0 > 1 > 1 > 1 > 0 > 0 > 0 > 0 > 1 > 1 > 1 > 0 > 1 > 1 > 0 >

Re: A desperate lunge for on-topic-ness

2012-10-19 Thread Tim Chase
On 10/19/12 17:14, Steven D'Aprano wrote: > Code never *needs* to be long, because it can always be shortened. I advocate one bit per line: 1 0 1 0 0 1 0 1 1 0 0 1 0 1 1 1 0 0 0 0 1 1 1 0 1 1 0 0 1 1 0 1 1 0 0 1 1 1 1 0 0 1 1 1 1 1 1 1 «grins, ducks, and flees» Shortenedly-yers, -tkc -- http

Re: A desperate lunge for on-topic-ness

2012-10-19 Thread Steven D'Aprano
On Fri, 19 Oct 2012 11:21:06 +0200, Jean-Michel Pichavant wrote: > Using 80+ char lines doesn't mean > I put all my efforts exceeding the 80 char limit. I didn't say it did. I was describing some of the reasons people might choose to stick to the 79 character limit, beyond the reason you gave,

Re: A desperate lunge for on-topic-ness

2012-10-19 Thread Krzysztof Voss
On Thursday, October 18, 2012 12:06:43 AM UTC-6, Zero Piraeus wrote: > : > > > > Okay, so, first thing vaguely Python-related that comes to mind [so > > probably not even slightly original, but then that's not really the > > point]: > > > > What are people's preferred strategies for dealing

Re: A desperate lunge for on-topic-ness

2012-10-19 Thread Demian Brecht
On 2012-10-18, at 6:34 PM, Steven D'Aprano wrote: > Flame away :) This post made my Friday, even though I'm sitting on a nearly two hour bus ride into work because I missed my commuter train. Just wanted you to know ;) You noted *every* reason (and them some) why my own code never passed 79

Re: A desperate lunge for on-topic-ness

2012-10-19 Thread Jean-Michel Pichavant
- Original Message - [snipe 80 char line discussion] > And, quite frankly, people who care more about the readability of > their > code than about squeezing in as much processing into a single line of > text as possible. > As usual Steven, you take someone's argument, you add a little

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Steven D'Aprano
On Thu, 18 Oct 2012 20:35:20 -0700, rusi wrote: (extracting the text without the ASCII-art) > > “When I get new information, I change my position. What, sir, > > do you do with new information?” —John Maynard Keynes > > “Anyone who believes exponential growth can go on forever in a > > finite wor

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread rusi
>  \       “When I get new information, I change my position. What, sir, | >   `\             do you do with new information?” —John Maynard Keynes | > _o__)                                                                  | > \ “Anyone who believes exponential growth can go on forever in a

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Dave Angel
On 10/18/2012 09:20 PM, Steven D'Aprano wrote: > On Thu, 18 Oct 2012 12:47:48 -0400, Dave Angel wrote: > >> I never use the backslash at end-of-line to continue a statement to the >> next. Not only is it a readability problem, but if your editor doesn't >> have visible spaces, you can accidentally

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Steven D'Aprano
On Thu, 18 Oct 2012 17:36:57 -0400, Zero Piraeus wrote: > The accepted rule in print is that lines of prose should be between 45 > and 90 characters, with 66 being ideal for readability. Code is not > prose, and the combination of fixed-width and much more variable line > length aids readability,

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Steven D'Aprano
On Thu, 18 Oct 2012 15:59:18 +0200, Jean-Michel Pichavant wrote: > - Original Message - >> On 2012-10-18, Zero Piraeus wrote: >> >> > What are people's preferred strategies for dealing with lines that go >> > over 79 characters? A few I can think of off the bat: >> >> I try to do what's

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Steven D'Aprano
On Thu, 18 Oct 2012 12:47:48 -0400, Dave Angel wrote: > I never use the backslash at end-of-line to continue a statement to the > next. Not only is it a readability problem, but if your editor doesn't > have visible spaces, you can accidentally have whitespace after the > backslash, and wonder wh

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Ben Finney
Jean-Michel Pichavant writes: > The 79 char limit purpose is to allow someone to read the code on a 80 > char terminal (and allow old printers to print the code). There is a very good reason for a strict line width limit regardless of terminal size: scanning long lines is cognitively more diffic

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Ben Finney
Hans Mulder writes: > On 18/10/12 08:31:51, Steven D'Aprano wrote: > > some_variable = spam('x') + ham( > > some_longer_variables, here_and_here, > > and_here_also) The indentation level for continuation lines shouldn't be dependent on the content of the

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Ben Finney
Zero Piraeus writes: > : > (Why is this colon appearing at the top of your messages? Can you remove it if it's not germane?) > What are people's preferred strategies for dealing with lines that go > over 79 characters? A few I can think of off the bat: > 1. Say "screw it" and go past 79, PEP8

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Gene Heskett
On Thursday 18 October 2012 18:40:52 Grant Edwards did opine: > On 2012-10-18, Den wrote: > > On Wednesday, October 17, 2012 11:06:43 PM UTC-7, Zero Piraeus wrote: > >> What are people's preferred strategies for dealing with lines that go > > > >> over 79 characters? A few I can think of off the

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Zero Piraeus
: On 18 October 2012 11:55, Den wrote: > [...] I'm amused by the whole question, and others related > to PEP8. A quick aside, the width of our roads all go back to the > width of a two horse rig. The suggested maximum of 80 characters goes > back to teletype machines, and IBM cards, and charact

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Ian Kelly
On Thu, Oct 18, 2012 at 10:47 AM, Dave Angel wrote: > I never use the backslash at end-of-line to continue a statement to the > next. Not only is it a readability problem, but if your editor doesn't > have visible spaces, you can accidentally have whitespace after the > backslash, and wonder what

RE: A desperate lunge for on-topic-ness

2012-10-18 Thread Prasad, Ramit
Hans Mulder wrote: > On 18/10/12 08:31:51, Steven D'Aprano wrote: > > On Thu, 18 Oct 2012 02:06:19 -0400, Zero Piraeus wrote: > >> 3. Say "well, at least it's not a backslash" and break the line using > >> > parentheses. > > I mostly do this. Since most lines include a bracket of some sort, I > > r

RE: A desperate lunge for on-topic-ness

2012-10-18 Thread Prasad, Ramit
Chris Angelico wrote: > On Fri, Oct 19, 2012 at 3:13 AM, Neil Cerutti wrote: > > Though technology has moved along swiftly, keeping your code > > accessible to the guy using a crummy old console xterm might > > still be worthwhile, and it makes printouts easy to create. > > And keeping your inte

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Joshua Landau
On 18 October 2012 12:05, Tim Chase wrote: > On 10/18/12 04:33, wxjmfa...@gmail.com wrote: > > I use a "double indentation". > > > if 'asdf' and 'asdf' and 'asdf' \ > > ... 'asdf' and 'asdf' and \ > > ... 'asdf' and 'asdf': > > ... print('do if') > > ... s = 'asdf' >

RE: A desperate lunge for on-topic-ness

2012-10-18 Thread Prasad, Ramit
Den wrote: > On Wednesday, October 17, 2012 11:06:43 PM UTC-7, Zero Piraeus wrote: > > : > > > > > > What are people's preferred strategies for dealing with lines that go > > > > over 79 characters? A few I can think of off the bat: > > > > I personally just keep typing until my statement is finis

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Grant Edwards
On 2012-10-18, Den wrote: > On Wednesday, October 17, 2012 11:06:43 PM UTC-7, Zero Piraeus wrote: > >> What are people's preferred strategies for dealing with lines that go >> >> over 79 characters? A few I can think of off the bat: > > I personally just keep typing until my statement is finished

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Dave Angel
On 10/18/2012 12:58 PM, Chris Kaynor wrote: > On Thu, Oct 18, 2012 at 9:47 AM, Dave Angel wrote: > >> >> But both C++ and Python have automatic concatenation of adjacent >> strings. So you can just start and end each line with a quote, and >> leave off the backslash. >> > That will work in C++ a

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Chris Kaynor
On Thu, Oct 18, 2012 at 9:47 AM, Dave Angel wrote: > On 10/18/2012 12:26 PM, Chris Angelico wrote: > > On Fri, Oct 19, 2012 at 3:16 AM, Evan Driscoll > wrote: > >>Python isn't as bad as C++ though (my main other language), where > >>80 characters can go by *very* quickly. > >> > >> 2. Ba

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Dave Angel
On 10/18/2012 12:26 PM, Chris Angelico wrote: > On Fri, Oct 19, 2012 at 3:16 AM, Evan Driscoll wrote: >>Python isn't as bad as C++ though (my main other language), where >>80 characters can go by *very* quickly. >> >> 2. Backslash continuations are *terrible*. I hate them with a firery >>

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Chris Angelico
On Fri, Oct 19, 2012 at 3:16 AM, Evan Driscoll wrote: >Python isn't as bad as C++ though (my main other language), where >80 characters can go by *very* quickly. > > 2. Backslash continuations are *terrible*. I hate them with a firery >passion. :-) A line could be 1000 characters long

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Chris Angelico
On Fri, Oct 19, 2012 at 3:13 AM, Neil Cerutti wrote: > Though technology has moved along swiftly, keeping your code > accessible to the guy using a crummy old console xterm might > still be worthwhile, and it makes printouts easy to create. And keeping your interface accessible to someone who can

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Chris Angelico
On Fri, Oct 19, 2012 at 2:49 AM, Dan Stromberg wrote: > In fact, I tend to do lots of "otherwise pointless" variables, because I > want to be able to quickly and easily insert print statements/functions > without having to split up large commands, during debugging. When will we next have a langu

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Evan Driscoll
Ooo, a good religious war. How could I resist? :-) Bear in mind that what I say is relative to layout issues, which in the grand scheme of things. So even if I say I really disklike something, it's still not so bad in practice. Except for backslash continuations. :-) On 10/18/2012 01:06 AM, Zero

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Neil Cerutti
On 2012-10-18, Den wrote: > But I have to say I'm amused by the whole question, and others > related to PEP8. A quick aside, the width of our roads all go > back to the width of a two horse rig. The suggested maximum of > 80 characters goes back to teletype machines, and IBM cards, > and charact

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Den
On Wednesday, October 17, 2012 11:06:43 PM UTC-7, Zero Piraeus wrote: > : > > > What are people's preferred strategies for dealing with lines that go > > over 79 characters? A few I can think of off the bat: > I personally just keep typing until my statement is finished. This is my program,

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Dan Stromberg
On Wed, Oct 17, 2012 at 11:06 PM, Zero Piraeus wrote: > : > > Okay, so, first thing vaguely Python-related that comes to mind [so > probably not even slightly original, but then that's not really the > point]: > > What are people's preferred strategies for dealing with lines that go > over 79 cha

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Jean-Michel Pichavant
- Original Message - > On 2012-10-18, Zero Piraeus wrote: > > > What are people's preferred strategies for dealing with lines that > > go > > over 79 characters? A few I can think of off the bat: > > I try to do what's easiest to read and understand. Sometimes that > means using a line

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Grant Edwards
On 2012-10-18, Zero Piraeus wrote: > What are people's preferred strategies for dealing with lines that go > over 79 characters? A few I can think of off the bat: I try to do what's easiest to read and understand. Sometimes that means using a line thats 120 characters long, sometimes that means

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Tim Chase
On 10/18/12 04:33, wxjmfa...@gmail.com wrote: > I use a "double indentation". > if 'asdf' and 'asdf' and 'asdf' \ > ... 'asdf' and 'asdf' and \ > ... 'asdf' and 'asdf': > ... print('do if') > ... s = 'asdf' > ... ss = 'asdf' > ... > do if if looks_like_it

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Zero Piraeus
: There seems to be a consensus [to the extent there ever is, anyway] around using parentheses etc., then ... On 18 October 2012 02:31, Steven D'Aprano wrote: > I've been burnt enough by word-wrapping in editors that don't handle word- > wrapping that well that it makes me really uncomfortable t

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Chris Angelico
On Thu, Oct 18, 2012 at 8:07 PM, Hans Mulder wrote: > > if looks_like_it_might_be_spam( > some_longer_variables, > here_and_here, and_here_also): > logger.notice("might be spam") > move_to_spam_folder(some_longer_variables) > update_spam_statistics(here_and_here) > This wants

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread wxjmfauth
Le jeudi 18 octobre 2012 11:07:25 UTC+2, Hans Mulder a écrit : > On 18/10/12 08:31:51, Steven D'Aprano wrote: > > > On Thu, 18 Oct 2012 02:06:19 -0400, Zero Piraeus wrote: > > >> 3. Say "well, at least it's not a backslash" and break the line using > > >> > parentheses. > > > I mostly do this.

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Mark Lawrence
On 18/10/2012 07:06, Zero Piraeus wrote: : Okay, so, first thing vaguely Python-related that comes to mind [so probably not even slightly original, but then that's not really the point]: What are people's preferred strategies for dealing with lines that go over 79 characters? A few I can think

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Hans Mulder
On 18/10/12 08:31:51, Steven D'Aprano wrote: > On Thu, 18 Oct 2012 02:06:19 -0400, Zero Piraeus wrote: >> 3. Say "well, at least it's not a backslash" and break the line using >> > parentheses. > I mostly do this. Since most lines include a bracket of some sort, I > rarely need to add outer parent

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Paul Rubin
Zero Piraeus writes: > 2. Say "screw it" and break the line using a backslash. Often the line will break ok without a backslash, but I don't feel any particular pain in using a backslash in the other cases. I do pretty rigorously try to keep all lines shorter than 72 columns or so, unless there'

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread rusi
On Oct 18, 11:06 am, Zero Piraeus wrote: > : > > Okay, so, first thing vaguely Python-related that comes to mind [so > probably not even slightly original, but then that's not really the > point]: > > What are people's preferred strategies for dealing with lines that go > over 79 characters? A few

Re: A desperate lunge for on-topic-ness

2012-10-17 Thread Demian Brecht
> 3. Say "well, at least it's not a backslash" and break the line using > parentheses. This. More times than not, there's a function call in that line, which makes sense to me when reading it if the args are on the next line. > 4. Spend 45 minutes trying to think up shorter [but still sensible] >

Re: A desperate lunge for on-topic-ness

2012-10-17 Thread Steven D'Aprano
On Thu, 18 Oct 2012 02:06:19 -0400, Zero Piraeus wrote: > What are people's preferred strategies for dealing with lines that go > over 79 characters? A few I can think of off the bat: > > 1. Say "screw it" and go past 79, PEP8 be damned. I've been burnt enough by word-wrapping in editors that do

Re: A desperate lunge for on-topic-ness

2012-10-17 Thread Chris Angelico
On Thu, Oct 18, 2012 at 5:06 PM, Zero Piraeus wrote: > What are people's preferred strategies for dealing with lines that go > over 79 characters? A few I can think of off the bat: > > 1. Say "screw it" and go past 79, PEP8 be damned. > > 6. Realise that if it's that long, it probably shouldn't ha

A desperate lunge for on-topic-ness

2012-10-17 Thread Zero Piraeus
: Okay, so, first thing vaguely Python-related that comes to mind [so probably not even slightly original, but then that's not really the point]: What are people's preferred strategies for dealing with lines that go over 79 characters? A few I can think of off the bat: 1. Say "screw it" and go p