Compare source code
usenet-nospam at seebs.net
Sat Nov 6 04:23:36 CET 2010
On 2010-11-06, Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> wrote:
> On Fri, 05 Nov 2010 18:45:39 +0000, Seebs wrote:
>> On 2010-11-05, Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au>
>>> Well there's your problem -- you are relying on tools that operate by
> Really? Then how did the logic get screwed up from a mere copy-and-paste
I inserted four spaces in front of a bunch of lines. :)
> [Aside: he isn't having problems with cutting and pasting code in Python,
> but in Emacs.]
> You *agreed with him*, and related your story. In context, I think it was
> perfectly reasonable to conclude that you too used C-M-q in Emacs, which
> then "magically indents the result". Mark's words, not mine.
Ahh, okay. I can see how you would have inferred that, but no, that's
not what I did.
> What god-awful editor are you using that can't copy and paste text
> without mangling it?
It's a side-effect of vi being, by default, configured to prefer to convert
things to tabs. The particular vi I'm using doesn't, so far as I know
"recognize" file formats, and that default behavior is not merely tolerable
but *preferable* for all of the dozens of other kinds of files I edit.
I've since learned to work around it, but the fact remains that, given a
fairly common behavior, which is *preferable* for every other context, I
ended up with a file where an operation which would have worked for
re-indenting any other language I use didn't for re-indenting Python.
I've long since figured out ways to prevent that, but that wasn't the
point; the point was how much harder it was to fix indentation once it
had gotten mangled than it would be in, oh, any other programming language
or file format I've used. (Even Makefiles are easier to fix, if only because
they're so much simpler.)
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam at seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.
More information about the Python-list