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

2011-09-02 Thread Seebs
On 2011-09-02, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

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

2011-08-31 Thread Seebs
On 2011-08-31, Chris Torek nos...@torek.net 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

Re: A tale of yak shaving

2011-08-29 Thread Seebs
On 2011-08-29, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

Re: is there any principle when writing python function

2011-08-23 Thread Seebs
On 2011-08-23, smith jack thinke...@gmail.com 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

Re: truncating strings

2011-08-23 Thread Seebs
On 2011-08-23, Roy Smith r...@panix.com 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?

Re: truncating strings

2011-08-23 Thread Seebs
On 2011-08-23, Ethan Furman et...@stoneleaf.us wrote: Seebs wrote: On 2011-08-23, Roy Smith r...@panix.com wrote: logger.error(FAILED: '%s{50}', '%s', %s, %s % (message, route, params, e.code)) does anything like this exist? %.50s That's not working in 2.7 or 3.2. Huh

Re: truncating strings

2011-08-23 Thread Seebs
On 2011-08-23, Ethan Furman et...@stoneleaf.us 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

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 andreas.loesc...@s2005.tu-chemnitz.de wrote: Am Sonntag, den 21.08.2011, 14:52 -0400 schrieb Roy Smith: In article mailman.282.1313951079.27778.python-l...@python.org, Christian Heimes li...@cheimes.de wrote: I don't think that's the reason. Modern compiles

Re: try... except with unknown error types

2011-08-19 Thread Seebs
On 2011-08-19, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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!

Re: List spam

2011-08-18 Thread Seebs
On 2011-08-18, Prasad, Ramit ramit.pra...@jpmorgan.com 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.

Re: Word Perfect integration

2011-08-18 Thread Seebs
On 2011-08-18, Ethan Furman et...@stoneleaf.us 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

Re: Wait for a keypress before continuing?

2011-08-17 Thread Seebs
On 2011-08-17, John Doe jdoe@usenetlove.invalid 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

Re: Wait for a keypress before continuing?

2011-08-17 Thread Seebs
On 2011-08-17, peter peter.mos...@talk21.com 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

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

2011-08-17 Thread Seebs
On 2011-08-17, Chris Angelico ros...@gmail.com 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 and

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

2011-08-17 Thread Seebs
On 2011-08-17, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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. Built-ins

Re: Wait for a keypress before continuing?

2011-08-17 Thread Seebs
On 2011-08-17, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

Re: Wait for a keypress before continuing?

2011-08-17 Thread Seebs
On 2011-08-17, Terry Reedy tjre...@udel.edu wrote: The difference is between Hit enter 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,

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

2011-08-17 Thread Seebs
On 2011-08-17, Ethan Furman et...@stoneleaf.us 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 any certainty. For all you know

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

2011-08-17 Thread Seebs
On 2011-08-17, Chris Angelico ros...@gmail.com wrote: On Wed, Aug 17, 2011 at 5:33 PM, Seebs usenet-nos...@seebs.net 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

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

2011-08-17 Thread Seebs
On 2011-08-17, Ethan Furman et...@stoneleaf.us 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

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

2011-08-16 Thread Seebs
On 2011-08-16, smith jack thinke...@gmail.com 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

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

2011-08-16 Thread Seebs
On 2011-08-16, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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,

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

2011-08-16 Thread Seebs
On 2011-08-16, Ethan Furman et...@stoneleaf.us 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

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

2011-08-16 Thread Seebs
On 2011-08-16, Ethan Furman et...@stoneleaf.us 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

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

2011-08-16 Thread Seebs
On 2011-08-16, Ethan Furman et...@stoneleaf.us 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 would be more along

Re: allow line break at operators

2011-08-16 Thread Seebs
On 2011-08-16, Prasad, Ramit ramit.pra...@jpmorgan.com 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

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

2011-08-16 Thread Seebs
On 2011-08-16, Terry Reedy tjre...@udel.edu 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 be to, well, prevent

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

2011-08-16 Thread Seebs
On 2011-08-17, Chris Angelico ros...@gmail.com wrote: On Wed, Aug 17, 2011 at 12:49 AM, Seebs usenet-nos...@seebs.net 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

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

2011-08-16 Thread Seebs
On 2011-08-17, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Seebs wrote: On 2011-08-16, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: *My* objects certainly are, because I write documentation for my code. My docs are no less official than Python's docs. Sure

Re: Wait for a keypress before continuing?

2011-08-16 Thread Seebs
On 2011-08-17, John Doe jdoe@usenetlove.invalid 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

Re: allow line break at operators

2011-08-15 Thread Seebs
On 2011-08-15, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

Re: allow line break at operators

2011-08-15 Thread Seebs
On 2011-08-15, Roy Smith r...@panix.com 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: Why no warnings when re-assigning builtin names?

2011-08-15 Thread Seebs
On 2011-08-15, Ethan Furman et...@stoneleaf.us 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

Re: allow line break at operators

2011-08-15 Thread Seebs
On 2011-08-16, Roy Smith r...@panix.com wrote: In article 4e492d08$0$30003$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: I'm reminded of this quote from John Baez: The real numbers are the dependable breadwinner of the family, the complete

Re: Ten rules to becoming a Python community member.

2011-08-15 Thread Seebs
On 2011-08-16, Roy Smith r...@panix.com wrote: In article 9att9mf71...@mid.individual.net, Gregory Ewing greg.ew...@canterbury.ac.nz 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

Re: Ten rules to becoming a Python community member.

2011-08-14 Thread Seebs
On 2011-08-14, rantingrick rantingr...@gmail.com 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

Re: allow line break at operators

2011-08-14 Thread Seebs
On 2011-08-14, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

Re: allow line break at operators

2011-08-14 Thread Seebs
On 2011-08-14, Chris Angelico ros...@gmail.com 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

Re: allow line break at operators

2011-08-14 Thread Seebs
On 2011-08-14, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

Re: allow line break at operators

2011-08-14 Thread Seebs
On 2011-08-14, Teemu Likonen tliko...@iki.fi 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

Re: pythonw.exe

2011-08-14 Thread Seebs
On 2011-08-14, Chris Angelico ros...@gmail.com 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

Re: Ten rules to becoming a Python community member.

2011-08-14 Thread Seebs
On 2011-08-15, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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 /

Re: allow line break at operators

2011-08-14 Thread Seebs
On 2011-08-15, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

Re: allow line break at operators

2011-08-14 Thread Seebs
On 2011-08-15, Chris Rebert c...@rebertia.com wrote: On Sun, Aug 14, 2011 at 6:54 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

Re: allow line break at operators

2011-08-12 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

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, Ben Finney ben+pyt...@benfinney.id.au wrote: Seebs usenet-nos...@seebs.net 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

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, Ben Finney ben+pyt...@benfinney.id.au wrote: Seebs usenet-nos...@seebs.net 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

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, Chris Angelico ros...@gmail.com wrote: On Fri, Aug 12, 2011 at 7:34 AM, Seebs usenet-nos...@seebs.net 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

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, rantingrick rantingr...@gmail.com 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

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, Chris Rebert c...@rebertia.com 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

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, Chris Angelico ros...@gmail.com 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

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, rantingrick rantingr...@gmail.com wrote: On Aug 12, 11:33?am, Seebs usenet-nos...@seebs.net 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 ros...@gmail.com wrote: On Fri, Aug 12, 2011 at 5:33 PM, Seebs usenet-nos...@seebs.net 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

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-12, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-13, Terry Reedy tjre...@udel.edu 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

Re: allow line break at operators

2011-08-12 Thread Seebs
On 2011-08-13, Ben Finney ben+pyt...@benfinney.id.au wrote: Seebs usenet-nos...@seebs.net writes: What's being pushed into the stream to indicate that the first outdent is two outdents and the second is one? See URL:http://docs.python.org/reference/lexical_analysis.html for a comprehensive

Re: allow line break at operators

2011-08-11 Thread Seebs
On 2011-08-11, Ben Finney ben+pyt...@benfinney.id.au 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

Re: allow line break at operators

2011-08-11 Thread Seebs
On 2011-08-11, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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 used for flow

Re: allow line break at operators

2011-08-11 Thread Seebs
On 2011-08-11, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

Re: allow line break at operators

2011-08-10 Thread Seebs
On 2011-08-10, Chris Angelico ros...@gmail.com 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

Re: allow line break at operators

2011-08-10 Thread Seebs
On 2011-08-11, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Seebs wrote: On 2011-08-10, Chris Angelico ros...@gmail.com 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

Re: allow line break at operators

2011-08-10 Thread Seebs
On 2011-08-10, Ben Finney ben+pyt...@benfinney.id.au wrote: Seebs usenet-nos...@seebs.net writes: On 2011-08-10, Chris Angelico ros...@gmail.com 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

Re: What was your strategy?

2010-11-14 Thread Seebs
On 2010-11-14, Jorge Biquez jbiq...@icsmx.com 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

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 l...@geek-central.gen.new_zealand 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

Re: How to test if a module exists?

2010-11-11 Thread Seebs
On 2010-11-11, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message mailman.843.1289438674.2218.python-l...@python.org, Tim Chase wrote: Amusingly, as others have noted, you replied with an unobfuscated email address. This

Re: How to test if a module exists?

2010-11-11 Thread Seebs
On 2010-11-11, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message mailman.894.1289510633.2218.python-l...@python.org, 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

Re: How to test if a module exists?

2010-11-11 Thread Seebs
On 2010-11-11, Tim Chase python.l...@tim.thechases.com wrote: === From: Lawrence D'Oliveiro unobfuscated Newsgroups: gmane.comp.python.general Oh, interesting. Gee...your unobfuscated email addresses FROM YOU. No, from gmane. Out here in comp.lang.python (no

Re: How to test if a module exists?

2010-11-11 Thread Seebs
On 2010-11-12, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand 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...

Re: Silly newbie question - Caret character (^)

2010-11-10 Thread Seebs
On 2010-11-10, Terry Reedy tjre...@udel.edu 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.

Re: Silly newbie question - Caret character (^)

2010-11-09 Thread Seebs
On 2010-11-09, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message slrnidhsbg.g2d.usenet-nos...@guild.seebs.net, 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

Re: Best exercises for beginers to learn?

2010-11-09 Thread Seebs
On 2010-11-08, brf...@gmail.com 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.

Re: Pythonic/idiomatic?

2010-11-09 Thread Seebs
On 2010-11-09, Jean-Michel Pichavant jeanmic...@sequans.com 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

Re: Silly newbie question - Caret character (^)

2010-11-09 Thread Seebs
On 2010-11-09, Terry Reedy tjre...@udel.edu 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

Re: Silly newbie question - Caret character (^)

2010-11-09 Thread Seebs
On 2010-11-10, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: What was sad to me to read http://www.seebs.net/c/c_tcn4e.html 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

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-08 Thread Seebs
On 2010-11-08, Michael Torrie torr...@gmail.com 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 vim settings

Re: Compare source code

2010-11-08 Thread Seebs
On 2010-11-08, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand 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

Re: Pythonic/idiomatic?

2010-11-08 Thread Seebs
On 2010-11-09, Ben Finney ben+pyt...@benfinney.id.au wrote: For this purpose, there is a generator expression syntax URL:http://docs.python.org/reference/expressions.html#generator-expressions, almost identical to a list comprehension except without the enclosing brackets. ' '.join(x for

Re: Commercial or Famous Applicattions.?

2010-11-08 Thread Seebs
On 2010-11-09, rantingrick rantingr...@gmail.com 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

Re: Pythonic/idiomatic?

2010-11-08 Thread Seebs
On 2010-11-09, Ben Finney ben+pyt...@benfinney.id.au wrote: Seebs usenet-nos...@seebs.net 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

Re: Silly newbie question - Carrot character (^)

2010-11-08 Thread Seebs
On 2010-11-09, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message mailman.697.1289067607.2218.python-l...@python.org, Dennis Lee Bieber wrote: Have you ever looked at the reference manual for Ada? Or even worse, the annotated reference. I thought annotations were

Re: Silly newbie question - Caret character (^)

2010-11-08 Thread Seebs
On 2010-11-09, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message slrnidhcns.9m6.usenet-nos...@guild.seebs.net, Seebs wrote: On 2010-11-09, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: Or even worse, the annotated reference. I thought annotations were

Re: Silly newbie question - Carrot character (^)

2010-11-07 Thread Seebs
On 2010-11-07, Nobody nob...@nowhere.com 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

Re: Compare source code

2010-11-07 Thread Seebs
On 2010-11-07, Grant Edwards inva...@invalid.invalid wrote: On 2010-11-07, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand 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

Re: Silly newbie question - Carrot character (^)

2010-11-07 Thread Seebs
On 2010-11-07, Roy Smith r...@panix.com 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

Re: Compare source code

2010-11-07 Thread Seebs
On 2010-11-07, Mark Wooding m...@distorted.org.uk 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

Re: Compare source code

2010-11-07 Thread Seebs
On 2010-11-07, Ethan Furman et...@stoneleaf.us wrote: Seebs wrote: On 2010-11-05, Ethan Furman et...@stoneleaf.us 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 would

Re: Compare source code

2010-11-06 Thread Seebs
On 2010-11-06, Steve Holden st...@holdenweb.com 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,

Re: Silly newbie question - Carrot character (^)

2010-11-06 Thread Seebs
On 2010-11-06, Hrvoje Niksic hnik...@xemacs.org 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

Re: Silly newbie question - Carrot character (^)

2010-11-06 Thread Seebs
On 2010-11-06, rantingrick rantingr...@gmail.com wrote: On Nov 5, 5:51?pm, Seebs usenet-nos...@seebs.net 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 a word HUMOR

Re: How to test if a module exists?

2010-11-06 Thread Seebs
On 2010-11-06, Roy Smith r...@panix.com 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

Re: Silly newbie question - Carrot character (^)

2010-11-06 Thread Seebs
On 2010-11-07, Steven D'Aprano st...@remove-this-cybersource.com.au 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

Re: Compare source code

2010-11-06 Thread Seebs
On 2010-11-07, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message slrnid9ln8.30fm.usenet-nos...@guild.seebs.net, 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

Re: Silly newbie question - Carrot character (^)

2010-11-06 Thread Seebs
On 2010-11-07, Hrvoje Niksic hnik...@xemacs.org 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

Re: Silly newbie question - Carrot character (^)

2010-11-06 Thread Seebs
On 2010-11-07, Roy Smith r...@panix.com 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

Re: Compare source code

2010-11-06 Thread Seebs
On 2010-11-07, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Sun, 07 Nov 2010 14:53:45 +1300, Lawrence D'Oliveiro wrote: In message slrnid9ln8.30fm.usenet-nos...@guild.seebs.net, Seebs wrote: Four spaces followed by a tab nearly always actually means eight spaces to most

Re: Compare source code

2010-11-05 Thread Seebs
On 2010-11-05, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: How does an edit accidentally add a trailing space to a large number of lines? I would love to know the answer to this question. However, empirically, it happens. My guess would be cutting and pasting in some way.

Re: Compare source code

2010-11-05 Thread Seebs
On 2010-11-05, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Thu, 04 Nov 2010 20:17:35 +, Seebs wrote: That was the thing which bit me the worst. I had a fairly large block of code in a first-pass ugly program. I wanted to start refactoring it, so I moved a big hunk

Re: Compare source code

2010-11-05 Thread Seebs
On 2010-11-05, Emile van Sebille em...@fenx.com wrote: So, which of your tools are you married to that are causing your issues? Python. -s -- Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nos...@seebs.net http://www.seebs.net/log/ -- lawsuits, religion, and funny pictures

  1   2   3   >