Re: which is better, string concatentation or substitution?

2006-05-07 Thread Leif K-Brooks
fuzzylollipop wrote: > niether .join() is the fastest Please quote what you're replying to. No, it's the slowest: [EMAIL PROTECTED]:~$ python -m timeit "'%s\n\n' % 'foobar'" 100 loops, best of 3: 0.607 usec per loop [EMAIL PROTECTED]:~$ python -m timeit "'' + 'foobar' + '\n\n'" 100 loops

Re: "Only one obvious way..."

2006-05-07 Thread JShrager
>If I ever _DO_ find a language that *DOES* mercilessly refactor in pursuit > of the ideal "only one obvious way", I may well jump ship, since my faith in > Python's adherence to this principle which I cherish so intensely has > been so badly broken ... The phrase "only one obvious way..." is near

Re: Why list.sort() don't return the list reference instead of None?

2006-05-07 Thread Lawrence Oluyede
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I want to ask why the designer of Python do so? I'm not a Python core developer nor a designer but I've always known that sort() is a in-place sort and since the list is a mutable object it mutates the list sending the "sort()" message. If you wan

Re: Why list.sort() don't return the list reference instead of None?

2006-05-07 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: > L = [4,3,2,1] > L=L.sort() > L will refer to None, why L.sort() don't return the L? > I want to ask why the designer of Python do so? Because that's the convention that signifies that a Python method mutates the object rather than returns a new one. -- Erik Max Franc

Re: Why list.sort() don't return the list reference instead of None?

2006-05-07 Thread Robert Kern
[EMAIL PROTECTED] wrote: > L = [4,3,2,1] > L=L.sort() > L will refer to None, why L.sort() don't return the L? > I want to ask why the designer of Python do so? http://www.python.org/doc/faq/general/#why-doesn-t-list-sort-return-the-sorted-list -- Robert Kern "I have come to believe that the wh

Why list.sort() don't return the list reference instead of None?

2006-05-07 Thread [EMAIL PROTECTED]
L = [4,3,2,1] L=L.sort() L will refer to None, why L.sort() don't return the L? I want to ask why the designer of Python do so? -- http://mail.python.org/mailman/listinfo/python-list

New pyparsing wiki

2006-05-07 Thread Paul McGuire
I've converted the pyparsing project home page to a wiki, hosted at http://pyparsing.wikispaces.com/ Please come and visit the new pyparsing project site, and add your contributions to the public Tips and Documentation pages! Thanks! -- Paul -- http://mail.python.org/mailman/listinfo/python-li

Re: why _import__ only works from interactive interpreter?

2006-05-07 Thread [EMAIL PROTECTED]
You are absolutely right, it's that empty entry that allows the absolute path to work. I'll probably add the path to sys.path, but as this is only a config file from which I need just a few vars, I'll try to use execfile, looking in past threads it looks like a better option for this use, I really

ANN: progressbar 2.2 - Text mode progressbar for console applications

2006-05-07 Thread Nilton Volpato
Text progressbar library for python. http://cheeseshop.python.org/pypi/progressbar This library provides a text mode progressbar. This is tipically used to display the progress of a long running operation, providing a visual clue that processing is underway. The ProgressBar class manages the p

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Adam Jones
Ken Tilton wrote: > Alexander Schmolck wrote: > > [trimmed groups] > > > > Ken Tilton <[EMAIL PROTECTED]> writes: > > > > > >>yes, but do not feel bad, everyone gets confused by the /analogy/ to > >>spreadsheets into thinking Cells /is/ a spreadsheet. In fact, for a brief > >>period I swore off th

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Alex Martelli
Patrick May <[EMAIL PROTECTED]> wrote: ...an alleged reply to me, which in fact quotes (and responds to) only to statements by Brian, without mentioning Brian... Mr May, it seems that you're badly confused regarding Usenet's quoting conventions. You may want to repeat your answer addressing spec

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Alex Martelli
Tomasz Zielonka <[EMAIL PROTECTED]> wrote: ... > Also, having anonymous functions doesn't take your common sense away, so > you still "have a chance". I've seen many people (presumably coming from Lisp or Scheme) code Python such as: myname = lambda ... rather than the obvious Python way to d

reading a column from a file

2006-05-07 Thread Gary Wessle
Hi I have a file with data like location pressure temp str flootfloot I need to read pressure and temp in 2 different variables so that I can plot them as lines. is there a package which reads from file with a given formate and returns desired variables? or I need to open, while not EO

Re: which is better, string concatentation or substitution?

2006-05-07 Thread fuzzylollipop
niether .join() is the fastest -- http://mail.python.org/mailman/listinfo/python-list

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Tomasz Zielonka
Alex Martelli wrote: > Worst case, you name all your functions Beverly so you don't have to > think about the naming I didn't think about this, probably because I am accustomed to Haskell, where you rather give functions different names (at the module top-level you have no other choice). I just ch

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Alex Martelli
Chris Lambacher <[EMAIL PROTECTED]> wrote: > On Sun, May 07, 2006 at 11:57:55AM -0700, Alex Martelli wrote: > > > [1] I'm considering introducing bugs or misdesigns that have to be > > > fixed > > > as part of training for the purposes of this discussion. Also the > > > > Actually, doing it _

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Alex Martelli
Frank Buss <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > > Not sure what the &key means here, but omitting that > > > > def black_white(function, limit): > > def result(x,y): > > if function(x, y) > limit: return 1.0 > > else: return 0.0 > > return result > > &ke

Re: the print statement

2006-05-07 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Thank you. Yes, that post answers most of the questions. I now have a > bit of an understanding of the \xhh pattern. It's still unclear to me, > however, how one can go from the \x92 pattern and arrive at the > apostrophe character. Is \x92 theh apostrophe character i

Re: Designing Plug-in Systems in Python

2006-05-07 Thread Kent Johnson
mystilleef wrote: > Hello, > > I need to design a plug-in system for a project. The goal is > to allow third party developers interact with an application > via plug-ins in a clean and robust manner. At this point I > am overwhelmed by my inexperience with designing plug-in > systems. One of thes

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Ken Tilton
Alexander Schmolck wrote: > [trimmed groups] > > Ken Tilton <[EMAIL PROTECTED]> writes: > > >>yes, but do not feel bad, everyone gets confused by the /analogy/ to >>spreadsheets into thinking Cells /is/ a spreadsheet. In fact, for a brief >>period I swore off the analogy because it was so inva

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Tomasz Zielonka
I V wrote: > Monads are one of those parts of functional programming I've never really > got my head around, but as I understand them, they're a way of > transforming what looks like a sequence of imperative programming > statements that operate on a global state into a sequence of function > calls

Re: which is better, string concatentation or substitution?

2006-05-07 Thread Leif K-Brooks
John Salerno wrote: > My initial feeling is that concatenation might take longer than > substitution Doesn't look that way: [EMAIL PROTECTED]:~$ python -m timeit "'%s\n\n' % 'foobar'" 100 loops, best of 3: 0.6 usec per loop [EMAIL PROTECTED]:~$ python -m timeit "'' + 'foobar' + '\n\n'" 1

dial-up from python script

2006-05-07 Thread Jon Van DeVries
I want to create a simple script that dials my modem to whatever number I specify. Any tips on modules to be used? google didn't help much this time. Platform: SuSE 10.1 Linux 2.6.x (but since it will be done in Python, I'm assuming it doesn't matter what platform I'm using right?) thanks in ad

Re: utility functions within a class?

2006-05-07 Thread blair . bethwaite
John Salerno wrote: > What I originally meant was that they would not be called from an > instance *outside* the class itself, i.e. they won't be used when > writing another script, they are only used by the class itself. Yep, so you want to encapsulate the functionality that those methods provide

which is better, string concatentation or substitution?

2006-05-07 Thread John Salerno
My initial feeling is that concatenation might take longer than substitution, but that it is also easier to read: def p(self, paragraph): self.source += '' + paragraph + '\n\n' vs. def p(self, paragraph): self.source += '%s\n\n' % paragraph Is there a preference between these two

Re: utility functions within a class?

2006-05-07 Thread John Salerno
[EMAIL PROTECTED] wrote: > I'm having trouble deciphering what this bit means - "but these > functions will be called from another method in the class, not from the > instance itself", I don't think it makes sense. Yeah, I'm starting to see that as I tried to implement it. Here's what I came up

Re: utility functions within a class?

2006-05-07 Thread blair . bethwaite
John Salerno wrote: > Ugh, sorry about another post, but let me clarify: In these utility > functions, I need to refer to an attribute of an instance, but these > functions will be called from another method in the class, not from the > instance itself. Is this even possible, or would 'self' have n

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Ken Tilton
[EMAIL PROTECTED] wrote: > Alex Martelli wrote: > >>Steve R. Hastings <[EMAIL PROTECTED]> wrote: >> ... >> But the key in the whole thread is simply that indentation will not scale. Nor will Python. >>> >>>This is a curious statement, given that Python is famous for scaling well. >> >>

How can I do this with python ?

2006-05-07 Thread Xiao Jianfeng
Dear all, In a shell script, I can run a command which need interactive input like this, #!/bin/sh A_Command<<-EOF a b c EOF But, how can I do this with python ? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: Image SIG ML Moderator does not respond

2006-05-07 Thread Robert Kern
Calvin Spealman wrote: > I have tried repeatedly to make a post to the Image SIG ML, and get > nothing but automated responses that I must wait for word from the > moderator to approve my posting on the list. I have gotten no reply, > positive or not, in over a month. I am assuming the Image SIG mo

Re: evaluation of >

2006-05-07 Thread John Machin
On 8/05/2006 12:45 PM, Gary Wessle wrote: > what does the i > a in this code mean. because the code below is > giving False for all the iteration. isn't suppose to evaluate each > value of i to the whole list? thanks But that's EXACTLY what it's doing; each integer value named i is notionally be

Re: utility functions within a class?

2006-05-07 Thread John Salerno
John Salerno wrote: > [EMAIL PROTECTED] wrote: > >> Even if you don't end up referring to self or any instance >> attributes within the method > > Hmm, follow-up: I *do* plan to refer to instance attributes inside these > methods (self.something), but does that require that they be instance > m

Re: utility functions within a class?

2006-05-07 Thread John Salerno
[EMAIL PROTECTED] wrote: > Even if you don't end up referring to self or any instance > attributes within the method Hmm, follow-up: I *do* plan to refer to instance attributes inside these methods (self.something), but does that require that they be instance methods, or can they still referenc

Image SIG ML Moderator does not respond

2006-05-07 Thread Calvin Spealman
I have tried repeatedly to make a post to the Image SIG ML, and get nothing but automated responses that I must wait for word from the moderator to approve my posting on the list. I have gotten no reply, positive or not, in over a month. I am assuming the Image SIG moderator is currently MIA. What

Re: utility functions within a class?

2006-05-07 Thread John Salerno
[EMAIL PROTECTED] wrote: > Even if you don't end up referring to self or any instance > attributes within the method, it's simpler to keep it as a normal > method. Thanks, that makes sense to me! So basically just create them as methods, and if I want a little 'privacy' I can lead with an unders

Re: evaluation of >

2006-05-07 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Gary Wessle <[EMAIL PROTECTED]> wrote: > Hi > > what does the i > a in this code mean. because the code below is > giving False for all the iteration. isn't suppose to evaluate each > value of i to the whole list? thanks > > a = range(8) > i = 0 > while i < 11: >

Re: utility functions within a class?

2006-05-07 Thread blair . bethwaite
> You do *NOT* want to put double-underscores before and after a method > name. That does not indicate a private method, it indicates a "magic > method" WHOOPS!! Sorry, I haven't touched python for a few months and just started working on a script this morning so was going to post my own questio

Getting HTTP responses - a python linkchecking script.

2006-05-07 Thread blair . bethwaite
Hi Folks, I'm thinking about writing a script that can be run over a whole site and produce a report about broken links etc... I've been playing with the urllib2 and httplib modules as a starting point and have found that with urllib2 it doesn't seem possible to get HTTP status codes. I've had m

Re: Python Eggs Just install in *ONE* place? Easy to uninstall?

2006-05-07 Thread [EMAIL PROTECTED]
But not matter where eggs are installed they are never spread across multiple places on hard drive right? An egg is all under one node of tree right? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Eggs Just install in *ONE* place? Easy to uninstall?

2006-05-07 Thread [EMAIL PROTECTED]
But not matter where eggs are installed they are never spread across multiple places on hard drive right? An egg is all under one node of tree right? -- http://mail.python.org/mailman/listinfo/python-list

Re: Numerical Python Tutorial errors

2006-05-07 Thread Gary Wessle
Robert Kern <[EMAIL PROTECTED]> writes: > Gary Wessle wrote: > > Hi > > > > is the Numerical Python tutorial maintained? > > http://www.pfdubois.com/numpy/html2/numpy.html > > seams to have some errors and no email to mail them to when found. > > No, it is not since Numeric itself is no longer m

evaluation of >

2006-05-07 Thread Gary Wessle
Hi what does the i > a in this code mean. because the code below is giving False for all the iteration. isn't suppose to evaluate each value of i to the whole list? thanks a = range(8) i = 0 while i < 11: print i > a i = i + 1 False False False False False False False False False False F

Re: utility functions within a class?

2006-05-07 Thread [EMAIL PROTECTED]
You do *NOT* want to put double-underscores before and after a method name. That does not indicate a private method, it indicates a "magic method" -- something that has special meaning to Python. Thus, you have special methods like __init__(), __len__(), __getattr__(), __setattr__(), etc; all of

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Chris Lambacher
On Sun, May 07, 2006 at 11:57:55AM -0700, Alex Martelli wrote: > > [1] I'm considering introducing bugs or misdesigns that have to be > > fixed > > as part of training for the purposes of this discussion. Also the > > Actually, doing it _deliberately_ (on "training projects" for new people > j

Re: utility functions within a class?

2006-05-07 Thread blair . bethwaite
It sounds like all you want is some encapsulation, the following makes methods __head__ and __body__ "private" - the double underscores are important. I'd suggest reading the Object bits of the python tutorial also. class HTMLWrapper: def generate(self, ...): ... self.__head__(foo

Re: python 2.5a2, gcc 4.1 and memory problems

2006-05-07 Thread Giovanni Bajo
Michele Petrazzo wrote: > Then I execute my test. The memory usage of 2.5a2 and gcc 3.3 that I > see with "top", is the same (about VIRT: 260 MB and RES: 250MB ) that > with the py 2.3 and 2.4, but then I recompile with 4.1 and execute > the same test, my system "stop to work"... with "top" I can

Re: why _import__ only works from interactive interpreter?

2006-05-07 Thread I V
On Sun, 07 May 2006 16:21:01 -0700, [EMAIL PROTECTED] wrote: > So, if this is right, I need to put the .py file to be imported inside > sys.path!! And the relative path will be usedto find the module. > > Can I __import__ providing the absolute path? >>> import sys >>> print sys.path ['', '/usr/l

utility functions within a class?

2006-05-07 Thread John Salerno
I might be missing something obvious here, but I decided to experiment with writing a program that involves a class, so I'm somewhat new to this in Python. Anyway, what is the best way to create a function (A) within a class that another function (B) can use? Function A is not something that an

Re: md5 from python different then md5 from command line

2006-05-07 Thread John Salerno
Paul Rubin wrote: > John Salerno <[EMAIL PROTECTED]> writes: >> Any reason you can't just read the whole file at once and update m? > > Yes, you could say > > print md5.new(file('foo.exe').read()).hexdigest() > > > but that means reading the whole file into memory at once. If the > file is v

Re: Can I use python for this .. ??

2006-05-07 Thread placid
Terry Reedy wrote: > "placid" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > .) > > > > When you hibernate/boot up/hibernate for a long time without a clean > > reboot, Windows becomes unstable... > > This seems to depend on the system. I have gone at least a week, maybe > two, w

Re: why _import__ only works from interactive interpreter?

2006-05-07 Thread [EMAIL PROTECTED]
It's not that, it looks like __import__looks into sys.path, so if use an absolute path it cannot work. I found this thread and it seems they are right: http://groups.google.com/group/comp.lang.python/browse_thread/thread/6eed0025488bf130/637790b4ed62

Re: why _import__ only works from interactive interpreter?

2006-05-07 Thread BartlebyScrivener
I'm on Windows, but I think you need the shebang thing at the top of your script, right? Then, put whatever you want to import in a script or module called testmod.py. Then you should be able to import either into a script or at the command line using simply: import testmod If it doesn't work t

Re: md5 from python different then md5 from command line

2006-05-07 Thread Paul Rubin
John Salerno <[EMAIL PROTECTED]> writes: > Any reason you can't just read the whole file at once and update m? Yes, you could say print md5.new(file('foo.exe').read()).hexdigest() but that means reading the whole file into memory at once. If the file is very large, that could thrash or fail.

Re: md5 from python different then md5 from command line

2006-05-07 Thread John Salerno
Paul Rubin wrote: > John Salerno <[EMAIL PROTECTED]> writes: >> Just a quick md5-related follow-up question: I was experimenting with >> it and making md5 sums for strings, but how do you use the md5 module >> to create a sum for an actual file, such as an .exe file? > > m = md5.new() > f = file('

Re: Swaying A Coder Away From Python

2006-05-07 Thread BJörn Lindqvist
On 5/4/06, Tim Williams <[EMAIL PROTECTED]> wrote: > > (and why do you > > seem to think that this matters, btw ?) > > I actually think it is complete twaddle, for the same reasons as you. I think this article has something to do with this article: http://www.paulgraham.com/submarine.html Maybe

Re: printing list

2006-05-07 Thread Dan Sommers
On Sun, 07 May 2006 18:16:22 -0400, Mel Wilson <[EMAIL PROTECTED]> wrote: > Tim Chase wrote: >> compboy wrote: >> >>> How do you print elements of the list in one line? >>> >>> alist = [1, 2, 5, 10, 15] >>> >>> so it will be like this: >>> 1, 2, 5, 10, 15 >> >> >> >>> print ', '.join(alist) >

why _import__ only works from interactive interpreter?

2006-05-07 Thread [EMAIL PROTECTED]
I don't know what I'm doing wrong, but the result is that _import_ only works from a python shell, but not when I call a python script. $ cat test.py mod = __import__("/home/me/tests/test_imp") Called from a script it does not work: $ python /home/me/test.py Traceback (most recent call last): F

Re: the tostring and XML methods in ElementTree

2006-05-07 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > O/S: Windows XP Home > Vsn of Python: 2.4 [snip fighting with unicode character U+2019 (RIGHT SINGLE QUOTATION MARK) ] I don't know what console you use but if it is IDLE you'll get confused even more because it is buggy and improperly handles that character: >>> print

Re: printing list

2006-05-07 Thread Mel Wilson
Tim Chase wrote: > compboy wrote: > >> How do you print elements of the list in one line? >> >> alist = [1, 2, 5, 10, 15] >> >> so it will be like this: >> 1, 2, 5, 10, 15 > > > >>> print ', '.join(alist) > 1, 2, 5, 10, 15 ??? Python 2.4.2 (#1, Jan 23 2006, 21:24:54) [GCC 3.3.4] on linux2 Typ

Re: the tostring and XML methods in ElementTree

2006-05-07 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > Question 1: assuming the following: > a) beforeCtag.text gets assigned a value of 'I\x92m confused' > b) afterRoot is built using the XML() method where the input to the > XML() method is the results of a tostring() method from beforeRoot > Are there any settings/argume

released: RPyC 2.55

2006-05-07 Thread gangesmaster
Remote Python Call (RPyC) - transparent and symmetrical python RPC and distributed computing library download and info: http://rpyc.wikispaces.com full changelog: http://rpyc.wikispaces.com/changelog release notes: http://rpyc.wikispaces.com/release+notes major changes: * added isinstance and iss

Re: Passing options around your program

2006-05-07 Thread alisonken1
Leo Breebaart wrote: > I have another question where I am not so much looking for a > solution but rather hoping to get some feedback on *which* > solutions people here consider good Pythonic ways to approach a > issue. > > The situation is this: I am writing fairly large console scripts > in Pytho

the tostring and XML methods in ElementTree

2006-05-07 Thread mirandacascade
O/S: Windows XP Home Vsn of Python: 2.4 Copy/paste of interactive window is immediately below; the text/questions toward the bottom of this post will refer to the content of the copy/paste >>> from elementtree import ElementTree >>> beforeRoot = ElementTree.Element('beforeRoot') >>> beforeCtag =

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Aaron Denney
["Followup-To:" header set to comp.lang.functional.] On 2006-05-07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > - it fits most programmers brains i.e. it is similar enough to > languages that most programmers have experience with and the > differences are usually perceived to ben

Re: Passing options around your program

2006-05-07 Thread [EMAIL PROTECTED]
When I have done this, I've used the last option -- creating a "config" module which can be imported wherever the configuration info is needed. (This module also handles any config files and/or Windows registry keys needed.) Using a Borg is a nice idea... but that ConfigBorg is probably going to

Re: (non)compositionality

2006-05-07 Thread JShrager
> There are *NO* semantic advantages for named vs unnamed functions in Python. I feel that this conversation has glanced off the point. Let me try a new approach: There is the Pythonic way (whatever that is), and then The Lisp Way. I don't know what the former is, but it has something to do with

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Alexander Schmolck
Bill Atkins <[EMAIL PROTECTED]> writes: > Here's how one of the cells examples might look in corrupted Python > (this is definitely not executable): > > class FallingRock: > def __init__(self, pos): > define_slot( 'velocity', lambda: self.accel * self.elapsed ) > define_slot( 'p

Re: Numerical Python Tutorial errors

2006-05-07 Thread Robert Kern
Gary Wessle wrote: > Hi > > is the Numerical Python tutorial maintained? > http://www.pfdubois.com/numpy/html2/numpy.html > seams to have some errors and no email to mail them to when found. No, it is not since Numeric itself is no longer maintained. The successor to Numeric is numpy and is being

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Bill Atkins
[EMAIL PROTECTED] writes: > Alex Martelli wrote: >> Steve R. Hastings <[EMAIL PROTECTED]> wrote: >>... >> > > But the key in the whole thread is simply that indentation will not >> > > scale. Nor will Python. >> > >> > This is a curious statement, given that Python is famous for scaling well.

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Patrick May
[EMAIL PROTECTED] (Alex Martelli) writes: >> >> In my opinion (and that of several others), the best way for >> >> Python to grow in this regard would be to _lose_ lambda >> >> altogether, since named functions are preferable >> > >> > Why? I find the ability to create unnamed functions on th

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Frank Buss
Alex Martelli wrote: > Not sure what the &key means here, but omitting that > > def black_white(function, limit): > def result(x,y): > if function(x, y) > limit: return 1.0 > else: return 0.0 > return result &key is something like keyword arguments in Python. And looks li

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread olsongt
Alex Martelli wrote: > Steve R. Hastings <[EMAIL PROTECTED]> wrote: >... > > > But the key in the whole thread is simply that indentation will not > > > scale. Nor will Python. > > > > This is a curious statement, given that Python is famous for scaling well. > > I think "ridiculous" is a bett

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Alex Martelli
Frank Buss <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > > Sorry, but I just don't see what lambda is buying you here. Taking just > > one simple example from the first page you quote, you have: > > > > (defun blank () > > "a blank picture" > > (lambda (a b c) > > (declare (igno

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Alex Martelli
Paul Rubin wrote: > [EMAIL PROTECTED] (Alex Martelli) writes: > > I do hate it that > > [ x for x in container if predicate(x) ] > > is an exact synonym of the more legible > > list( x for x in container if predicate(x) ) > > Heh, I hate it that it's NOT an exac

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Frank Buss
Alex Martelli wrote: > Sorry, but I just don't see what lambda is buying you here. Taking just > one simple example from the first page you quote, you have: > > (defun blank () > "a blank picture" > (lambda (a b c) > (declare (ignore a b c)) > '())) You are right, for this example i

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Carl Friedrich Bolz
Bill Atkins wrote: [snip] >>Here's how one of the cells examples might look in corrupted Python >>(this is definitely not executable): >> >> class FallingRock: >>def __init__(self, pos): >> define_slot( 'velocity', lambda: self.accel * self.elapsed ) >> define_slot( 'pos', lambda: se

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > I do hate it that > [ x for x in container if predicate(x) ] > is an exact synonym of the more legible > list( x for x in container if predicate(x) ) Heh, I hate it that it's NOT an exact synonym (the listcomp leaves 'x' polluting the namespace a

Re: algorithmic mathematical art

2006-05-07 Thread Alex Hunsley
Xah Lee wrote: > i've long time been interested in algorithmic mathematical art. That > is, mathematical or algorithmic visual art works that are generated by > computer such that the program's source code reflects the algorithmic > essence of the visual quality in the art work. (for detail, see >

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > Patrick May wrote: > > [EMAIL PROTECTED] (Alex Martelli) writes: > >> In my opinion (and that of several others), the best way for Python to > >> grow in this regard would be to _lose_ lambda altogether, since named > >> functions are preferable > > > > Why? I fi

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Alex Martelli
Frank Buss <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > > I cannot conceive of one. Wherever within a statement I could write the > > expression > > lambda : body > > I can *ALWAYS* obtain the identical effect by picking an otherwise > > locally unused identifier X, writing the stat

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Alex Martelli
I V <[EMAIL PROTECTED]> wrote: ... > >> higher level languages. There are useful programming techniques, like > >> monadic programming, that are infeasible without anonymous functions. > >> Anonymous functions really add some power to the language. > > > > Can you give me one example that would

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Alex Martelli
Tomasz Zielonka <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > Tomasz Zielonka <[EMAIL PROTECTED]> wrote: > > > >> Alex Martelli wrote: > >> > Having to give functions a name places no "ceiling on expressiveness", > >> > any more than, say, having to give _macros_ a name. > >> > >> And wha

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Alex Martelli
Carl Friedrich Bolz <[EMAIL PROTECTED]> wrote: ... > > an extension that allows the programmer to specify how the value of > > some slot (Lisp lingo for "member variable") can be computed. It > > frees the programmer from having to recompute slot values since Cells ... > I have not looked at

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: ... > >> 2. There has to be a mechanism where an organization can add > >>developers - even if it is only for new projects. Python advocates > > > > Obviously. > > It's good that you agree. I think that the ability to add new > productive developers to a project/t

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: ... > > Being able to keep pass around state with functions is useful. > > I agree and Python supports this. What is interesting is how > counter-intuitive many programmers find this. For example, one of my Funny: I have taught/mentored large number of people in Pyth

Re: md5 from python different then md5 from command line

2006-05-07 Thread Paul Rubin
John Salerno <[EMAIL PROTECTED]> writes: > Just a quick md5-related follow-up question: I was experimenting with > it and making md5 sums for strings, but how do you use the md5 module > to create a sum for an actual file, such as an .exe file? m = md5.new() f = file('foo.exe', 'b') # open in bin

Re: algorithmic mathematical art

2006-05-07 Thread Alex Hunsley
Xah Lee wrote: > i've long time been interested in algorithmic mathematical art. That > is, mathematical or algorithmic visual art works that are generated by > computer such that the program's source code reflects the algorithmic > essence of the visual quality in the art work. (for detail, see >

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Bill Atkins
Bill Atkins <[EMAIL PROTECTED]> writes: > Alexander Schmolck <[EMAIL PROTECTED]> writes: > >> [trimmed groups] >> >> Ken Tilton <[EMAIL PROTECTED]> writes: >> >>> yes, but do not feel bad, everyone gets confused by the /analogy/ to >>> spreadsheets into thinking Cells /is/ a spreadsheet. In fact,

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Bill Atkins
Alexander Schmolck <[EMAIL PROTECTED]> writes: > [trimmed groups] > > Ken Tilton <[EMAIL PROTECTED]> writes: > >> yes, but do not feel bad, everyone gets confused by the /analogy/ to >> spreadsheets into thinking Cells /is/ a spreadsheet. In fact, for a brief >> period I swore off the analogy beca

Python CHM Doc Contains Broken Links on Linux in xCHM.

2006-05-07 Thread vbgunz
Hello! this is the main error: http://img406.imageshack.us/img406/5218/screenshotxchmerror1ae.png navigation link images broken here: http://img406.imageshack.us/img406/2822/screenshotxchmv12python24docum.png when I first open up the docs, the main page and Global Module Index links in the tree

Re: md5 from python different then md5 from command line

2006-05-07 Thread John Salerno
[EMAIL PROTECTED] wrote: > Hi > > I noticed that the md5 computed with md5 module from python is > different then the md5 sum computed with md5sum utility (on slackware > and gentoo). > > i.e. > $echo marius|md5sum > 0f0f60ac801a9eec2163083a22307deb - > test = md5.new("marius") print t

Re: algorithmic mathematical art

2006-05-07 Thread verec
On 2006-05-07 12:31:47 +0100, Frank Buss <[EMAIL PROTECTED]> said: >> anyway, today i ran into this page by Frank Buß >> http://www.frank-buss.de/lisp/functional.html >> which used the idea in the book to render a traditional Escher's tiling >> piece. > > I should note that I've used the original

Re: md5 from python different then md5 from command line

2006-05-07 Thread Paul Rubin
"Marius Ursache" <[EMAIL PROTECTED]> writes: > >>>> import md5 > >>>> test = md5.new("marius\n") > >>>> print test.hexdigest() > >0f0f60ac801a9eec2163083a22307deb > > Thanks, that was it ;) Also, the -n option suppresses the newline from echo: $ echo -n marius | md5sum 242aa1a977

Passing options around your program

2006-05-07 Thread Leo Breebaart
I have another question where I am not so much looking for a solution but rather hoping to get some feedback on *which* solutions people here consider good Pythonic ways to approach a issue. The situation is this: I am writing fairly large console scripts in Python. They have quite a few command-l

Numerical Python Tutorial errors

2006-05-07 Thread Gary Wessle
Hi is the Numerical Python tutorial maintained? http://www.pfdubois.com/numpy/html2/numpy.html seams to have some errors and no email to mail them to when found. if interested, read about the errors below (1) http://www.pfduboi

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Alexander Schmolck
[trimmed groups] Ken Tilton <[EMAIL PROTECTED]> writes: > yes, but do not feel bad, everyone gets confused by the /analogy/ to > spreadsheets into thinking Cells /is/ a spreadsheet. In fact, for a brief > period I swore off the analogy because it was so invariably misunderstood. > Even Graham mis

Re: printing list

2006-05-07 Thread Tim Williams
On 7 May 2006 09:15:10 -0700, compboy <[EMAIL PROTECTED]> wrote: > How do you print elements of the list in one line? > > alist = [1, 2, 5, 10, 15] > > so it will be like this: > 1, 2, 5, 10, 15 > > because if I use this code > > for i in alist: > print i > > the result would be like this > > 1

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Ken Tilton
Ken Tilton wrote: > > > Serge Orlov wrote: > >> Ken Tilton wrote: >> >>> It is vastly more disappointing that an alleged tech genius would sniff >>> at the chance to take undeserved credit for PyCells, something probably >>> better than a similar project on which Adobe (your superiors at >>> s

Re: printing list

2006-05-07 Thread Raymond L. Buvel
compboy wrote: > How do you print elements of the list in one line? > > alist = [1, 2, 5, 10, 15] > > so it will be like this: > 1, 2, 5, 10, 15 > > because if I use this code > > for i in alist: > print i > > the result would be like this > > 1 > 2 > 5 > 10 > 15 > > Thanks. > There ar

Re: printing list

2006-05-07 Thread Tim Chase
compboy wrote: > How do you print elements of the list in one line? > > alist = [1, 2, 5, 10, 15] > > so it will be like this: > 1, 2, 5, 10, 15 >>> print ', '.join(alist) 1, 2, 5, 10, 15 -tkc -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >