Re: Why doesn't threading.join() return a value?

2011-09-02 Thread Seebs
On 2011-09-02, Steven D'Aprano wrote: > Roy Smith wrote: >> I have a function I want to run in a thread and return a value. It >> seems like the most obvious way to do this is to have my target >> function return the value, the Thread object stash that someplace, and >> return it as the return va

Re: Why no warnings when re-assigning builtin names?

2011-08-31 Thread Seebs
On 2011-08-31, Chris Torek wrote: > (I realize this thread is old. I have been away for a few weeks. > I read through the whole thread, though, and did not see anyone > bring up this one particular point: there is already a linting > script that handles this.) Yes. I've found pylint... A weird

Re: A tale of yak shaving

2011-08-29 Thread Seebs
On 2011-08-29, Steven D'Aprano wrote: > This is not exactly fresh (it was written back in March), but it's the first > time I saw it and I thought I'd share. Barry Warsaw, one of the lead Python > developers, describes one of his most ... interesting ... debugging > experiences. That is a truly e

Re: truncating strings

2011-08-23 Thread Seebs
On 2011-08-23, Ethan Furman wrote: > Ah -- that's only part of it -- the OP wants '...' to print as well. :) O. Hmm. That's harder. I can't think of a pretty way, so I think I'd probably write a "prettytrunc(string, len)" or something similar. -s -- Copyright 2011, all wrongs reversed.

Re: truncating strings

2011-08-23 Thread Seebs
On 2011-08-23, Ethan Furman wrote: > Seebs wrote: >> On 2011-08-23, Roy Smith wrote: >>> logger.error("FAILED: '%s{50}', '%s', %s, %s" % (message, >>> route, params, e.code)) >>> does anything like this exist? >>

Re: truncating strings

2011-08-23 Thread Seebs
On 2011-08-23, Roy Smith wrote: > I want to log a string but only the first bunch of it, and add "..." > to the end if it got truncated. This certainly works: > logger.error("FAILED: '%s{50}', '%s', %s, %s" % (message, > route, params, e.code)) > does anything like this exist? %.50s

Re: is there any principle when writing python function

2011-08-23 Thread Seebs
On 2011-08-23, smith jack wrote: > i have heard that function invocation in python is expensive, but make > lots of functions are a good design habit in many other languages, so > is there any principle when writing python function? Lots of them. None of them have to do with performance. > for

Re: relative speed of incremention syntaxes (or "i=i+1" VS "i+=1")

2011-08-21 Thread Seebs
On 2011-08-21, Andreas L?scher wrote: > Am Sonntag, den 21.08.2011, 14:52 -0400 schrieb Roy Smith: >> In article , >> Christian Heimes wrote: >> > I don't think that's the reason. Modern compiles turn a switch statement >> > into a jump or branch table rather than a linear search like chained >>

Re: try... except with unknown error types

2011-08-19 Thread Seebs
On 2011-08-19, Steven D'Aprano wrote: > Even if you don't think it's the ethical thing to do, consider that someday > you might be maintaining code written by the OP :) A common further conclusion people reach is "but then I will be able to get a job fixing it!" Trust me, this is NOT where you w

Re: Word Perfect integration

2011-08-18 Thread Seebs
On 2011-08-18, Ethan Furman wrote: > Yes, we still use Word Perfect, and will as long as it is available. > The ability to see the codes in use (bold, margins, columns, etc) has so > far been unequaled in anything else I have looked at. I have used other software that had this functionality, bu

Re: List spam

2011-08-18 Thread Seebs
On 2011-08-18, Prasad, Ramit wrote: >>> Or 'Enter a Python keyword (search the tutorial if you do not know any) >>> ' >> >>Sounds good, but now you've trained the spammer who is without a doubt >>watching this list. > > Teach them Python before they can post, I like it! I don't. If I want

Re: Why no warnings when re-assigning builtin names?

2011-08-17 Thread Seebs
On 2011-08-17, Ethan Furman wrote: > Part of the fun of Python is experimentation. And how much fun is it to > be told over and over, "No, you can't do that"? Okay, I buy that. Actually, this sort of fits with my experience of how (sane) people do it in Ruby. And I'm really the wrong person t

Re: Why no warnings when re-assigning builtin names?

2011-08-17 Thread Seebs
On 2011-08-17, Chris Angelico wrote: > On Wed, Aug 17, 2011 at 5:33 PM, Seebs wrote: >> If it's such a bad thing, *why is it allowed*? ?Why are you proud of the >> ability to do something that you are never socially-allowed to do? > Going back to my original three exa

Re: Why no warnings when re-assigning builtin names?

2011-08-17 Thread Seebs
On 2011-08-17, Ethan Furman wrote: > Seebs wrote: >> On 2011-08-17, Steven D'Aprano wrote: >>> Ah, well you see the thing is, this is Python. As soon as you call any >>> function you don't control, you no longer know what your environment is >>> with

Re: Wait for a keypress before continuing?

2011-08-17 Thread Seebs
On 2011-08-17, Terry Reedy wrote: > The difference is between "Hit to continue" (which we can do in > portable Python) versus "Hit any key to continue" (which we cannot, and > which also leads to the joke about people searching for the 'any' key > ;-). And more importantly, frustration and co

Re: Wait for a keypress before continuing?

2011-08-17 Thread Seebs
On 2011-08-17, Steven D'Aprano wrote: > I shouldn't need to say this to anyone over the age of four, but being > obnoxious to people trying to help does not encourage others to answer your > question. You don't win points for insulting people who are trying to solve > your problems. The frustrati

Re: Why no warnings when re-assigning builtin names?

2011-08-17 Thread Seebs
On 2011-08-17, Steven D'Aprano wrote: > On Wed, 17 Aug 2011 01:17 pm Seebs wrote: > [...] >> "Another" scope is normally a horizontal thing -- you're talking about >> a different scope such that you are *either* in this one *or* in that >> one. >&

Re: Wait for a keypress before continuing?

2011-08-17 Thread Seebs
On 2011-08-17, peter wrote: > Is there an equivalent to msvcrt for Linux users? I haven't found > one, and have resorted to some very clumsy code which turns off > keyboard excho then reads stdin. Seems such an obvious thing to want > to do I am surprised there is not a standard library module fo

Re: Why no warnings when re-assigning builtin names?

2011-08-17 Thread Seebs
On 2011-08-17, Chris Angelico wrote: > def foo(list): >"""Foo's the list provided and returns True on success or False on > failure.""" > > def bar(list): > """Counts the number of bars in the list, assuming it to be made > of music.""" > if not foo(list): return > You call foo() once

Re: Wait for a keypress before continuing?

2011-08-16 Thread Seebs
On 2011-08-17, John Doe wrote: > Context is lost when you quote only one level. Not significantly. > I was not answering a question about my code. I was pointing out > the fact that my questioner's terminology is strange/corrupt. Well, that's the thing. There was a question there, with perf

Re: Wait for a keypress before continuing?

2011-08-16 Thread Seebs
On 2011-08-17, John Doe wrote: > Using "does your code have a GUI" produces zero search results. > Maybe that works better in some other language. You shouldn't need a search engine to answer a question about your code. If you do, it suggests that perhaps one or more of the terms are unfamiliar

Re: Why no warnings when re-assigning builtin names?

2011-08-16 Thread Seebs
On 2011-08-17, Steven D'Aprano wrote: > Seebs wrote: >> On 2011-08-16, Steven D'Aprano >> wrote: >>> *My* objects certainly are, because I write documentation for my code. My >>> docs are no less official than Python's docs. >> Sure the

Re: Why no warnings when re-assigning builtin names?

2011-08-16 Thread Seebs
On 2011-08-17, Chris Angelico wrote: > On Wed, Aug 17, 2011 at 12:49 AM, Seebs wrote: >> Yes, but is it a *significant* cost? ?My assumption is that the suppression >> would be of checking, not just of displaying messages. > It mightn't be very significant, but the

Re: Why no warnings when re-assigning builtin names?

2011-08-16 Thread Seebs
On 2011-08-16, Terry Reedy wrote: > On 8/16/2011 2:56 PM, Seebs wrote: >> I wonder whether there's a way to mitigate the cost of these things by >> messing with -W settings, such that runtime that wants to be fast can >> omit the checks, but the default could still b

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: Why no warnings when re-assigning builtin names?

2011-08-16 Thread Seebs
On 2011-08-16, Ethan Furman wrote: > Seebs wrote: >> The quality of C code I have to deal with has increased dramatically as >> gcc's aggressive use of warnings has spread. > With gcc you pay the cost once, with Python you would pay it with every > run. A linter wou

Re: Why no warnings when re-assigning builtin names?

2011-08-16 Thread Seebs
On 2011-08-16, Ethan Furman wrote: > What makes you think it's unintentional? Programming experience. People *often* do things unintentionally. > Seems to me the real issue is somebody using a builtin, such as str or > int, and that they somehow manage to do this without realizing, "wait a >

Re: Why no warnings when re-assigning builtin names?

2011-08-16 Thread Seebs
On 2011-08-16, Ethan Furman wrote: > I think warnings should be reserved for language changes and such (like > DeprecationWarning, RuntimeWarning, and FutureWarning), not for possible > programmer mistakes. I disagree, on the basis of the following: The quality of C code I have to deal with ha

Re: Why no warnings when re-assigning builtin names?

2011-08-16 Thread Seebs
On 2011-08-16, Steven D'Aprano wrote: > On Tue, 16 Aug 2011 01:23 pm Philip Semanchuk wrote: >>> Why should built-ins be treated as more sacred than your own objects? >> Because built-ins are described in the official documentation as having a >> specific behavior, while my objects are not. > *

Re: Anyone here can do a comparation between Djang and RoR

2011-08-16 Thread Seebs
On 2011-08-16, smith jack wrote: > what is the advantage of Django over RoR:) This question is pretty much... I mean, you're not gonna get useful answers. They're based on such different languages that I think any comparison past that is likely going to be uninteresting to a programmer, and I'm

Re: Ten rules to becoming a Python community member.

2011-08-15 Thread Seebs
On 2011-08-16, Roy Smith wrote: > In article <9att9mf71...@mid.individual.net>, > Gregory Ewing wrote: > >> I don't mind people using e.g. and i.e. as long >> as they use them *correctly*. > > The only correct way to use i.e. is to use it to download a better > browser. Similarly: Boy, is the

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: Why no warnings when re-assigning builtin names?

2011-08-15 Thread Seebs
On 2011-08-15, Ethan Furman wrote: > Gerrat Rickert wrote: >> What sayest the Python community about having an explicit warning >> against such un-pythonic behaviour (re-assigning builtin names)? > What makes you think this behavior is unpythonic? Python is not about > hand-holding. It seems

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 = ar

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: Ten rules to becoming a Python community member.

2011-08-14 Thread Seebs
On 2011-08-15, Steven D'Aprano wrote: > And yet, here you are, engaging him in conversation and feeding him the > attention he craves :( Many cultures have a tradition of almsgiving. -s -- Copyright 2011, all wrongs reversed. Peter Seebach / usenet-nos...@seebs.net http://www.seebs.net/log/ <-

Re: pythonw.exe

2011-08-14 Thread Seebs
On 2011-08-14, Chris Angelico wrote: > Just to confuse things even further, it's not unlikely that a Mac or > Linux or Windows computer will have DOSBox installed. Is *that* DOS? > Technically no, but practically yes. Depending on how you define "unlikely", I'd guess it is. Assume that "unlikely

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

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 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: >> >> bla

Re: Ten rules to becoming a Python community member.

2011-08-14 Thread Seebs
On 2011-08-14, rantingrick wrote: > Follow these simply rules to become an accepted member of the Python > community. > 1. Bash rantingrick and Xah Lee every chance you get. ... If I'd known you were in the same category as him, I wouldn't have needed to wait until now to know to plonk you. -s

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

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 c

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 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&

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

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 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 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

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 brace

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,

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 Seebs
On 2011-08-11, Steven D'Aprano wrote: > Steven D'Aprano wrote: >> indentation as flow control > Gah! Of course, I meant indentation for blocks... after making the earlier > point that indentation is *not* used for flow control, this was a > particularly egregious error. > How embarrassment. My

Re: allow line break at operators

2011-08-11 Thread Seebs
On 2011-08-11, Steven D'Aprano wrote: > Seebs wrote: >> I have seen all the counterarguments, and what I've >> mostly become convinced of is this: >> 1. Indentation as flow control was a bad idea. > I'm not aware of any language where indentation is use

Re: allow line break at operators

2011-08-11 Thread Seebs
On 2011-08-11, Ben Finney wrote: > What evidence do you have of these? The latter, especially, seems to be > mere opinion unfounded in any measurement. Well, on new collection of data, I'm less convinced. The basic rule is: Engineers are nearly always aware of tradeoffs. If I suddenly encounte

Re: allow line break at operators

2011-08-10 Thread Seebs
On 2011-08-10, Ben Finney wrote: > Seebs writes: >> On 2011-08-10, Chris Angelico wrote: >> > And if we require {} then truly free indentation should be OK too! >> > But it wouldn't be Python any more. >> Would it really not be Python at all? > See the

Re: allow line break at operators

2011-08-10 Thread Seebs
On 2011-08-11, Steven D'Aprano wrote: > Seebs wrote: >> On 2011-08-10, Chris Angelico wrote: >>> And if we require {} then truly free indentation should be OK too! But >>> it wouldn't be Python any more. >> Would it really not be Python at all? > O

Re: allow line break at operators

2011-08-10 Thread Seebs
On 2011-08-10, Chris Angelico wrote: > And if we require {} then truly free indentation should be OK too! But > it wouldn't be Python any more. Would it really not be Python at all? I've seen bits of code in preprocessing-based "Python with {}" type things, and they still look like Python to me,

Re: What was your strategy?

2010-11-14 Thread Seebs
On 2010-11-14, Jorge Biquez wrote: > I was wondering if you can share what was the strategy you followed > to master Python (Yes I know I have to work hard study and practice a > lot). I mean did you use special books, special sites, a plan to > learn each subject in a special way. I would like

Re: How to test if a module exists?

2010-11-11 Thread Seebs
On 2010-11-12, Lawrence D'Oliveiro wrote: > I have just received an admission from Barry Warsaw that a hack was done on > python-list specifically to deal with bounces caused by a list member trying > to reply to my obfuscated e-mail address. That's... Fascinating. But it does mean that the pe

Re: How to test if a module exists?

2010-11-11 Thread Seebs
On 2010-11-11, Tim Chase wrote: >=== > From: Lawrence D'Oliveiro > Newsgroups: gmane.comp.python.general Oh, interesting. > Gee...your unobfuscated email addresses FROM YOU. No, from gmane. Out here in comp.lang.python (no gmane), it's obfuscated. So it sounds lik

Re: How to test if a module exists?

2010-11-11 Thread Seebs
On 2010-11-11, Lawrence D'Oliveiro wrote: > In message , MRAB wrote: >> ... the next one at 3 Nov 2010 22:40 "Re: Allowing comments after the line >> continuation backslash" and _all_ the subsequent ones arrived with an >> _unobfuscated_ email address. > You mean from this one on >

Re: How to test if a module exists?

2010-11-11 Thread Seebs
On 2010-11-11, Lawrence D'Oliveiro wrote: > In message , Tim Chase > wrote: >> Amusingly, as others have noted, you replied with an unobfuscated >> email address. > This > > would seem to be an independent, true record of

Re: Silly newbie question - Caret character (^)

2010-11-11 Thread Seebs
(Note followups, this has stopped being very Pythony.) On 2010-11-11, Lawrence D'Oliveiro wrote: > Another function that should be deprecated is strncat???I myself was caught > out misunderstanding it recently. What purpose does it serve? I'm wondering if you're thinking of strncpy(), which is

Re: Silly newbie question - Caret character (^)

2010-11-10 Thread Seebs
On 2010-11-10, Terry Reedy wrote: > I was referring to Schildt using gets() all the time and thereby > teaching new C generations to do he same. Ahh, yes. I am told that the current plan is to kill it in C1X. I would shed no tears. -s -- Copyright 2010, all wrongs reversed. Peter Seebach /

Re: Silly newbie question - Caret character (^)

2010-11-09 Thread Seebs
On 2010-11-10, Lawrence D'Oliveiro wrote: > What was sad to me to read was this > phrase of yours: > ... but rather, takes the shortest path to something that won't get > those complaints anymore ... > To me, this is the sign of someone who doesn't

Re: Silly newbie question - Caret character (^)

2010-11-09 Thread Seebs
On 2010-11-09, Terry Reedy wrote: > I've been wondering why C programmers keep writing code susceptible to > buffer overruns ;=). Because we're dumb! (Actually, in my defense, my code almost never, if ever, has buffer overruns. I do in some rare cases have truncation issues with sufficiently

Re: Pythonic/idiomatic?

2010-11-09 Thread Seebs
On 2010-11-09, Jean-Michel Pichavant wrote: > One pythonic way to do it, is to use an option parser. That seems like massive overkill -- I don't care about any of the other options. It seems like it'd result in doing more work to get and then extract the options, and most of that would be discar

Re: Best exercises for beginers to learn?

2010-11-09 Thread Seebs
On 2010-11-08, brf...@gmail.com wrote: > I was wondering if there are any good exercises that you > would recommend learning? Yes. *Write something you want to use.* Nothing will teach you programming as fast as programming stuff you care about for the joy of having it. Exercises that you don'

Re: Silly newbie question - Caret character (^)

2010-11-09 Thread Seebs
On 2010-11-09, Lawrence D'Oliveiro wrote: > In message , Seebs wrote: >> Not so much turgidity as being WRONG. Consistently and often. > Wow. And the guy???s written so many books; how does he get away with it? No one knows or cares. I don't mean "no one knows or

Re: Silly newbie question - Caret character (^)

2010-11-08 Thread Seebs
On 2010-11-09, Lawrence D'Oliveiro wrote: > In message , Seebs wrote: >> On 2010-11-09, Lawrence D'Oliveiro >> wrote: >>> Or even worse, the annotated reference. I thought annotations were >>> supposed to clarify things; in this case they seemed to

Re: Silly newbie question - Carrot character (^)

2010-11-08 Thread Seebs
On 2010-11-09, Lawrence D'Oliveiro wrote: > In message , Dennis Lee > Bieber wrote: >> Have you ever looked at the reference manual for Ada? > Or even worse, the annotated reference. I thought annotations were supposed > to clarify things; in this case they seemed to have the opposite effect...

Re: Pythonic/idiomatic?

2010-11-08 Thread Seebs
On 2010-11-09, Ben Finney wrote: > Seebs writes: >> I think we're stuck with backwards compatibility at least as far as >> 2.4. > Then you don't yet have the ???any??? and ???all??? built-in functions, or the > tuple-of-prefixes feature of ???str.startswith??? ei

Re: Commercial or Famous Applicattions.?

2010-11-08 Thread Seebs
On 2010-11-09, rantingrick wrote: > Commenting on which language is better than "this one" or which > language boasts the most achievements is nothing more than time very > poorly spent. This is mostly true, but I don't think it's entirely true. It is certainly possible for someone else's langua

Re: Pythonic/idiomatic?

2010-11-08 Thread Seebs
On 2010-11-09, Ben Finney wrote: > For this purpose, there is a generator expression syntax >http://docs.python.org/reference/expressions.html#generator-expressions>, > almost identical to a list comprehension except without the enclosing > brackets. > > ' '.join(x for x in target_cflags.split

Re: Compare source code

2010-11-08 Thread Seebs
On 2010-11-08, Lawrence D'Oliveiro wrote: > In message <87oca1b8ba.fsf@metalzone.distorted.org.uk>, Mark Wooding > wrote: >> Vertical space is a limiting factor on how much code one can see at a >> time. > One thing that helps me is that Emacs has commands for quickly jumping > between matc

Re: Compare source code

2010-11-08 Thread Seebs
On 2010-11-08, Michael Torrie wrote: > On 11/06/2010 02:27 AM, Seebs wrote: >> I have yet to find an editor that allows me to, well, *edit*, more >> comfortably than vi. > Indeed vi (or in my case, vim) works wonderfully well with python. I > always use the following v

Pythonic/idiomatic?

2010-11-08 Thread Seebs
I have an existing hunk of Makefile code: CPPFLAGS = "$(filter -D* -I* -i* -U*,$(TARGET_CFLAGS))" For those not familiar with GNU makeisms, this means "assemble a string which consists of all the words in $(TARGET_CFLAGS) which start with one of -D, -I, -i, or -U". So if you give it

Re: Compare source code

2010-11-07 Thread Seebs
On 2010-11-07, Ethan Furman wrote: > Seebs wrote: >> On 2010-11-05, Ethan Furman wrote: >>> The verifiable benefit for me is ease of use, ease of thought, ease of >>> typing... I realize these are not benefits for everyone, but they are >>> for some -- and I

Re: Compare source code

2010-11-07 Thread Seebs
On 2010-11-07, Mark Wooding wrote: > I've no idea how people manage with these ridiculous widescreen monitors. Side space used for Other Stuff. It takes some reworking of the layout, but overall I sorta like it now. -s -- Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nos...@seeb

Re: Silly newbie question - Carrot character (^)

2010-11-07 Thread Seebs
On 2010-11-07, Roy Smith wrote: > Well, maybe I was being a little sarcastic. The real point was that if > you make it hard for people to do the right thing (i.e. look up the > details in the reference manual), you should not be surprised if they do > the wrong thing (i.e. find some way to mak

Re: Compare source code

2010-11-07 Thread Seebs
On 2010-11-07, Grant Edwards wrote: > On 2010-11-07, Lawrence D'Oliveiro wrote: >> In message <87sjzige0r@benfinney.id.au>, Ben Finney wrote: >>> The more general answer is: the block is explicitly ended where the >>> indentation ends. >> That's implicit, not explicit. > If you can _see_ it

Re: Silly newbie question - Carrot character (^)

2010-11-06 Thread Seebs
On 2010-11-07, Nobody wrote: > I'm arguing that the reference manual reads too much like a specification. > E.g. look at "5.2.4. List displays" and tell me whether you consider that > it adequately /explains/ list displays to someone wishing to use them. Seems pretty explanatory to me. I mean, m

Re: Compare source code

2010-11-06 Thread Seebs
On 2010-11-07, Steven D'Aprano wrote: > On Sun, 07 Nov 2010 14:53:45 +1300, Lawrence D'Oliveiro wrote: >> In message , Seebs wrote: >>> Four spaces followed by a tab nearly always actually means "eight >>> spaces" to most editors (and Python seems t

Re: Silly newbie question - Carrot character (^)

2010-11-06 Thread Seebs
On 2010-11-07, Roy Smith wrote: > Any self-respecting C++ programmer would have given > up the scavenger hunt by now. Just kept throwing typecasts at your code > until it compiles, and move on. That does not sound like a self-respecting programmer of anything. -s -- Copyright 2010, all wrong

Re: Silly newbie question - Carrot character (^)

2010-11-06 Thread Seebs
On 2010-11-07, Hrvoje Niksic wrote: > It's not a matter of quality, but of intended audience. To most > ordinary programmers the standards documents such as the C standard, the > C++ standard, or the Python reference are quite dense and hard to use as > a reference, and yet they are considered qu

Re: Compare source code

2010-11-06 Thread Seebs
On 2010-11-07, Lawrence D'Oliveiro wrote: > In message , Seebs wrote: >> Four spaces followed by a tab nearly always actually means "eight spaces" >> to most editors (and Python seems to treat it that way), but it's hard to >> tell. Worse, a tab may have b

Re: Silly newbie question - Carrot character (^)

2010-11-06 Thread Seebs
On 2010-11-07, Steven D'Aprano wrote: > Surely a tutorial tells you *how* to use the language. I wouldn't expect > a reference manual to teach me how to run and edit programs -- the *how* > of using the language. There's a sort of fuzzy boundary about how the term "reference manual" is used. S

Re: How to test if a module exists?

2010-11-06 Thread Seebs
On 2010-11-06, Roy Smith wrote: > from __future__ import bugs Now I want this. -s -- Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nos...@seebs.net http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get ed

Re: Silly newbie question - Carrot character (^)

2010-11-06 Thread Seebs
On 2010-11-06, rantingrick wrote: > On Nov 5, 5:51?pm, Seebs wrote: >> I'm a bit lost here. ?Could you highlight some of the differences >> between "a reference manual for the language itself" and "something >> written for language lawyers"? > In

Re: Silly newbie question - Carrot character (^)

2010-11-06 Thread Seebs
On 2010-11-06, Hrvoje Niksic wrote: > I don't speak for "Nobody", but to me a reference manual would be a > document intended for the user of the language. The thing for the > language lawyer is something intended for the implementor, or possibly > for the very advanced user who argues with the i

Re: Compare source code

2010-11-06 Thread Seebs
On 2010-11-06, Steve Holden wrote: > If someone were to use a text editor which had always historically > mangled whitespace I would find myself wondering why they found it > necessary to restrict themselves to such stone-age tools. I have yet to find an editor that allows me to, well, *edit*, mo

Re: Compare source code

2010-11-05 Thread Seebs
On 2010-11-06, Steven D'Aprano wrote: > On Fri, 05 Nov 2010 08:17:02 +0530, Rustom Mody wrote: >> However the original question -- mixing tabs and spaces is bad -- has >> got lost in the flames. Do the most die-hard python fanboys deny this? >> And if not is it asking too much (say in python3) t

Re: Silly newbie question - Carrot character (^)

2010-11-05 Thread Seebs
On 2010-11-06, Philip Semanchuk wrote: > The former refers to something that programmers would use to learn >the language once they've gone through the tutorial a few times. >The latter is great for writing a Python parser but isn't the >friendliest guide to language constructs. That sounds, then

Re: Compare source code

2010-11-05 Thread Seebs
ine and is no hassle if you have suitable tools, it is of course ridiculous to suggest that people should need to change away from tools which currently suit them fine. > Why is it the responsibility of the programming language syntax to > correct the problem with Seebs' faulty mail serve

  1   2   3   >