Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-02 Thread Steven D'Aprano
On Fri, 01 Jul 2005 13:42:10 -0400, Mike Meyer wrote: > "iK" <[EMAIL PROTECTED]> writes: > >> Seems like he wants python programmers to solve their problems all in the >> same way. While that is great for corporate slaves it is terrible for the >> creative programmer. > > No, he wants Python t

Re: Inheriting from object

2005-07-02 Thread John Roth
"Bengt Richter" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I wonder if the above common use of super could be implemented as a > property of object, > so you'd normally inherit it and be able to write >self.super.__init__(*args, **kwargs) # (maybe spell it > self.__super

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-02 Thread Steven D'Aprano
On Fri, 01 Jul 2005 19:15:46 -0700, Erik Max Francis wrote: > Sean McIlroy wrote: > >> if that's the case then list >> comprehensions and/or "first class functions" are likely to be the next >> target. > > Slippery slope arguments are logical fallacies, you know. Not if you are actually standin

Re: Python for everything?

2005-07-02 Thread Mike Meyer
Christos "TZOTZIOY" Georgiou <[EMAIL PROTECTED]> writes: > On Thu, 30 Jun 2005 20:55:20 -0400, rumours say that Mike Meyer > <[EMAIL PROTECTED]> might have written: > >>Actually, I was thinking of pre-K&R Unix compilers. > > There must be something I am missing here, cause I don't understand what

Re: Another newbie question from Nathan.

2005-07-02 Thread Steven D'Aprano
On Sat, 02 Jul 2005 00:25:00 -0600, Nathan Pinno wrote: > > > Hi all. > > How do I make the computer generate 4 random numbers for the guess? I want > to know because I'm writing a computer program in Python like the game > MasterMind. First you get the computer to generate one random numb

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-07-02 Thread Grant Edwards
On 2005-07-03, Darkfalz <[EMAIL PROTECTED]> wrote: > I find this amusing even when they have the most cockney, ghetto > English accent, Americans still find it "sophisticated". No they don't. Americans have pretty much the same stereotypes about regional English accents that the average Brit doe

Re: Favorite non-python language trick?

2005-07-02 Thread Christopher Subich
Steven D'Aprano wrote: > On Fri, 01 Jul 2005 12:24:44 -0700, Devan L wrote: > > >>With the exception of reduce(lambda x,y:x*y, sequence), reduce can be >>replaced with sum, and Guido wants to add a product function. > > > How do you replace: > > reduce(lambda x,y: x*y-1/y, sequence) > > with

Re: Determining actual elapsed (wall-clock) time

2005-07-02 Thread flamesrock
I've needed to do something similar in the past and used free ntp servers. Of course you need an internet connection: http://ntp.isc.org/bin/view/Servers/NTPPoolServers http://www.nightsong.com/phr/python/setclock.py You could also have a startup script spawn a thread that stores the time persiste

Re: Inheriting from object

2005-07-02 Thread Bengt Richter
On Sat, 02 Jul 2005 14:17:32 -0400, Peter Hansen <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: >> BTW, there's something about referring to type(self) by its not >> always dependably bound (though usually global) name that bothers me. >> >> I wonder if the above common use of super could be im

Re: What are the other options against Zope?

2005-07-02 Thread Terry Hancock
On Saturday 02 July 2005 04:26 pm, phil wrote: > > A rather object-oriented system for managing and serving web > > applications and data (using object inheritance for common behavior, > > etc.) This makes Zope a toolkit, not an end application itself. > > So that would make it Apache, with a Pyth

Re: Python, mysql, floating point values question

2005-07-02 Thread Terry Hancock
On Saturday 02 July 2005 08:53 pm, Dennis Lee Bieber wrote: > On Sat, 2 Jul 2005 18:49:20 -0400, Christopher Kang > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > I've been doing the epsilon comparisons, i had just hoped that to be a > > temporary solution. > > > Consid

math.nroot [was Re: A brief question.]

2005-07-02 Thread Steven D'Aprano
On Sun, 03 Jul 2005 02:22:23 +0200, Fredrik Johansson wrote: > On 7/3/05, Tom Anderson <[EMAIL PROTECTED]> wrote: >> That's one way. I'd do: >> >> root = value ** 0.5 >> >> Does that mean we can expect Guido to drop math.sqrt in py3k? :) > > I'd rather like to see a well implemented math.nthroo

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-02 Thread Devan L
Claiming that sum etc. do the same job is the whimper of someone who doesn't want to openly disagree with Guido. Could you give an example where sum cannot do the job(besides the previously mentioned product situation? Also, map is easily replaced. map(f1, sequence) == [f1(element) for element i

Folding in vim

2005-07-02 Thread Terry Hancock
My general attitude towards IDEs and editors has been extremely conservative, but today I decided to see what this "folding" business was all about. I see that vim (and gvim, which is what I actually use) has this feature, and it is fairly nice, but at present it's very manual --- and frankly it

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-02 Thread Peter Hansen
Steven D'Aprano wrote: > On Fri, 01 Jul 2005 13:42:10 -0400, Mike Meyer wrote: >>No, he wants Python to be Pythonic. TMTOWTDI is not Pythonic. > > Too Many T--- Only Way To Do It? > > There Might Tangle One Way To Do It? > > T--- M--- Two Obvious Ways To Do It? > > Nope, sorry, still not gettin

Re: Python, mysql, floating point values question

2005-07-02 Thread Peter Hansen
Terry Hancock wrote: > On Saturday 02 July 2005 08:53 pm, Dennis Lee Bieber wrote: > And for that matter, some of the posters here have *been* 14. Terry, almost every single one of the posters here have been 14. At some time. :-) -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Favorite non-python language trick?

2005-07-02 Thread Devan L
sum(sequence[0] + [1/element for element in sequence[1:]]) I think that should work. -- http://mail.python.org/mailman/listinfo/python-list

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-02 Thread Steven D'Aprano
On Sat, 02 Jul 2005 20:26:31 -0700, Devan L wrote: > Claiming that sum etc. do the same job is the whimper of > someone who doesn't want to openly disagree with Guido. > > Could you give an example where sum cannot do the job(besides the > previously mentioned product situation? There is an inf

Re: Favorite non-python language trick?

2005-07-02 Thread Christopher Subich
Devan L wrote: > sum(sequence[0] + [1/element for element in sequence[1:]]) > > I think that should work. That won't work, because it misses the x*y part of the expression (x[n]*x[n+1] + 1/x[n+1], for people who haven't immediately read the grandparent). Personally, I think demanding that it b

Re: What are the other options against Zope?

2005-07-02 Thread Mike Meyer
Terry Hancock <[EMAIL PROTECTED]> writes: > This is true in the same sense that Python is unnecessary > because all programs can be written in assembler. Or machine > code for that matter. Entered by flipping switches, even -- throw > away that keyboard. > > I have actually seen this done, BTW.

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-02 Thread Christopher Subich
Steven D'Aprano wrote: > comps. But reduce can't be written as a list comp, only as a relatively > complex for loop at a HUGE loss of readability -- and I've never used > Lisp or Scheme in my life. I'm surely not the only one. See my reply to your other post for a more detailed explanation, but I

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-02 Thread Jp Calderone
On Sun, 03 Jul 2005 01:01:18 -0400, Christopher Subich <[EMAIL PROTECTED]> wrote: >Steven D'Aprano wrote: >> comps. But reduce can't be written as a list comp, only as a relatively >> complex for loop at a HUGE loss of readability -- and I've never used >> Lisp or Scheme in my life. I'm surely not

Re: What are the other options against Zope?

2005-07-02 Thread Christopher Subich
Dennis Lee Bieber wrote: > The Windows registry is "a maze of twisty little passages, all > alike" ITYM "a maze of twisty little passeges, {058C1536-2201-11D2-BFC1-00805F858323}" > The registry a cryptic, bloated, system by which M$ can hide > details about anything they want... In

Will Guido's "Python Regrets" ever get implemented/fixed?

2005-07-02 Thread [EMAIL PROTECTED]
Guido gave a nice "Python Regrets" Power Point talk at OSCON few years ago. I was wondering if the plan is to ever implement these ideas. e.g. Guido said he'd prefer 'print' to be a *function* with perhaps a 'println' version IIRC. He also had a ton of stuff he'd rather see become iterato

Re: Will Guido's "Python Regrets" ever get implemented/fixed?

2005-07-02 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Guido gave a nice "Python Regrets" Power Point talk at OSCON few years > ago. > > I was wondering if the plan is to ever implement these ideas. > > e.g. Guido said he'd prefer 'print' to be a *function* with perhaps a > 'println' version IIRC. > >He also had a

Re: Python, mysql, floating point values question

2005-07-02 Thread Terry Hancock
On Saturday 02 July 2005 10:50 pm, Peter Hansen wrote: > Terry Hancock wrote: > > On Saturday 02 July 2005 08:53 pm, Dennis Lee Bieber wrote: > > And for that matter, some of the posters here have *been* 14. > > Terry, almost every single one of the posters here have been 14. > At some time. :-) U

Re: Will Guido's "Python Regrets" ever get implemented/fixed?

2005-07-02 Thread Jordan Rastrick
Python 3000 is the proveribal and so far hypothetical version of the language in which backward incompatible changes will be allowed (and encouraged). See http://www.python.org/peps/pep-3000.html for details. [EMAIL PROTECTED] wrote: > Guido gave a nice "Python Regrets" Power Point talk at OSCO

Re: PIL question: keeping metadata

2005-07-02 Thread Ilpo Nyyssönen
"Will McCutchen" <[EMAIL PROTECTED]> writes: >> Is there any way of keeping this info in PIL? > > I don't think so... when I investigated in the past, I think I > discovered that the PIL can't write EXIF data (I might be wrong, > though, or my information might be outdated). There is this: http:

Re: Folding in vim

2005-07-02 Thread Ron Adam
Terry Hancock wrote: > My general attitude towards IDEs and editors has been > extremely conservative, but today I decided to see what > this "folding" business was all about. > > I see that vim (and gvim, which is what I actually use) > has this feature, and it is fairly nice, but at present i

Re: POP3 and "seen" flag

2005-07-02 Thread Miki Tebeka
Hello Peter, > > Is there a way to know in a POP session of a message was seen (old) or not > > (new)? > > Define "seen". It could be interpreted as either "TOP" or "RETR" having > been executing for a message, or something like "this client has seen > this message before" ... not sure what yo

Re: Favorite non-python language trick?

2005-07-02 Thread James
Steven D'Aprano wrote: > On Fri, 24 Jun 2005 14:29:37 -0700, James wrote: > > > Interesting thread ... > > > > 1.) Language support for ranges as in Ada/Pascal/Ruby > > 1..10 rather than range(1, 10) > > What advantages do Pascal-like for loops give over Python for loops? > > The only two I can thi

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-02 Thread Ron Adam
Steven D'Aprano wrote: > On Sat, 02 Jul 2005 20:26:31 -0700, Devan L wrote: > > >> Claiming that sum etc. do the same job is the whimper of >>someone who doesn't want to openly disagree with Guido. >> >>Could you give an example where sum cannot do the job(besides the >>previously mentioned prod

Re: Will Guido's "Python Regrets" ever get implemented/fixed?

2005-07-02 Thread [EMAIL PROTECTED]
Thanks! Even the fact that these ideas have been organized into a PEP is exciting to methere is hope that they may *someday* be implemented. Maybe sooner than people think. Another reason to love Python like no other. Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: What's wrong with this code?

2005-07-02 Thread Nathan Pinno
Hi all, Sure I'm able to publish the code, only the previous version though. If you want the first version; find Josh Cogliati, and ask him. It didn't have a random function, though. I got the idea to improve it from my computer course. Here is the code: #Plays the guessing game higher

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-02 Thread Erik Max Francis
Ron Adam wrote: > But together, sum and product, probably cover about 90% of situations in > which you would use reduce. Getting a total (sum) from a list probably > covers 80% of the situations reduce would be used on it's own. (I can't > think of any real uses of product at the moment. It's

How to get 4 numbers from the user in one line for easy comparision?

2005-07-02 Thread Nathan Pinno
I saw that great idea from Steven, and I appreciate it. I think it will work. Just need to figure out how to get 4 numbers from the player on one line for easy comparison, e.g. telling whether the number is correct position and number, incorrect position and correct number, or both are incorr

<    1   2