Amara XML Toolkit 0.9.1 changes

2004-12-31 Thread Uche Ogbuji
Forgot the changes in the original announcement: * Fixed embarrassing misinterpretation of sax.handler.feature_namespace_prefixes Now Namespace prefixes work fine with or without PyXML installed * Add saxtools.namespace_mixin utility class * Clean up bindery.document_base name attributes *

Re: The Industry choice

2004-12-31 Thread Alan Gauld
On 30 Dec 2004 08:58:36 -0800, Sridhar R [EMAIL PROTECTED] wrote: What makes such companies to choose Java over dynamic, productive languages like Python? Are there any viable, technical reasons for that? Decisions are made by men in suits who read very expensive business magazines, read

Re: The Industry choice

2004-12-31 Thread Paul Rubin
Sridhar R [EMAIL PROTECTED] writes: What makes such companies to choose Java over dynamic, productive languages like Python? Are there any viable, technical reasons for that? I think you have to be more careful when you program in Python. Java is statically typed and can do all kinds of

RE: Is there a better way of listing Windows shares other than us ing os.listdir

2004-12-31 Thread Doran_Dermot
Hi David, Thanks for the bit of code on finding shares! I'd been using something a bit different (win32com.client stuff) but your code looks better. I've found that win32file.FindFilesIterator (suggested to me by another person on this mailing list) allows the gui to remain responsive. Using

Re: Securing a future for anonymous functions in Python

2004-12-31 Thread Ian Bicking
John Roth wrote: I appreciate some of the motivation, but merely avoiding giving something a name doesn't seem like a laudible goal. Actually, it is a laudable goal. It's always easier to understand something when it's right in front of your face than if it's off somewhere else. Naming the

py2app on Mac OS X 10.3

2004-12-31 Thread Austin
Minimal setup.py example, run with: % python setup.py py2app from distutils.core import setup import py2app setup( app = ['main.py'], ) That is a sample code of wiki. I have a file 'main.py' and several sub-folders. After I execute 'pythonw setup.py py2exe', I see 2 folders, 'dist'

Re: More baby squeaking - iterators in a class

2004-12-31 Thread Bulba!
On Thu, 30 Dec 2004 12:06:31 -0800, Scott David Daniels [EMAIL PROTECTED] wrote: Here's one way: # (Make __iter__ an iterator) Py class R1(object): def __init__(self, data): self.data = data self.i = len(data) def __iter__(self): while

Re: Speed ain't bad

2004-12-31 Thread Craig Ringer
On Fri, 2004-12-31 at 11:17, Jeremy Bowers wrote: I would point out a couple of other ideas, though you may be aware of them: Compressing all the files seperately, if they are small, may greatly reduce the final compression since similarities between the files can not be exploited. True;

Re: The Industry choice

2004-12-31 Thread Bulba!
On Thu, 30 Dec 2004 12:59:57 -0500, Steve Holden [EMAIL PROTECTED] wrote: We either need time for folks to accept dynamic, scripting languages, or a lot of modern language programmers need to gang up against managers and stuff. :) [...] Right, what have the managers ever done for us? I must

Re: copying classes?

2004-12-31 Thread harold fellermann
On 30.12.2004, at 01:24, It's me wrote: I would not think that a generic deepcopy would work for all cases. An object can be as simple as a number, for instance, but can also be as complex as the universe. I can't imagine anybody would know how to copy a complex object otherthen the object

Re: The Industry choice

2004-12-31 Thread Peter Dembinski
Thomas Bartkus [EMAIL PROTECTED] writes: [...] What makes such companies to choose Java over dynamic, productive languages like Python? Are there any viable, technical reasons for that? Are there viable, technical reasons? That would be doubtful. But There is a reason very

Re: py2app on Mac OS X 10.3

2004-12-31 Thread Ronald Oussoren
On 31-dec-04, at 11:12, Austin wrote: Minimal setup.py example, run with: % python setup.py py2app from distutils.core import setup import py2app setup( app = ['main.py'], ) That is a sample code of wiki. I have a file 'main.py' and several sub-folders. After I execute 'pythonw setup.py

Re: The Industry choice

2004-12-31 Thread Christopher Koppler
On Fri, 31 Dec 2004 02:13:27 +0100, Bulba! wrote: On 30 Dec 2004 08:58:36 -0800, Sridhar R [EMAIL PROTECTED] wrote: [snip] What makes such companies to choose Java over dynamic, productive languages like Python? Are there any viable, technical reasons for that? It's the $$$ of the big

Re: The Industry choice

2004-12-31 Thread Christopher Koppler
On Fri, 31 Dec 2004 12:05:47 +0100, Peter Dembinski wrote: Thomas Bartkus [EMAIL PROTECTED] writes: [...] What makes such companies to choose Java over dynamic, productive languages like Python? Are there any viable, technical reasons for that? Are there viable, technical reasons?

Re: copying classes?

2004-12-31 Thread Alex Martelli
harold fellermann [EMAIL PROTECTED] wrote: ... I always think that a well designed object should have a copyme method. :=) That would be __copy__ or __deepcopy__, but the __getstate__ / __setstate__ approach is often preferable. take a look at the __setstate__ and __getstate__

Re: The Industry choice

2004-12-31 Thread Paul Rubin
Christopher Koppler [EMAIL PROTECTED] writes: The moral is, of course, that either the Python community's alpha geeks need to get access to controlling interest in a *major* company (or to become successful enough with their own companies to register on the current *major* companies radar as

Re: How about pure virtual methods?

2004-12-31 Thread Noam Raphael
Thanks for your suggestion, but it has several problems which the added class solves: * This is a very long code just to write you must implement this method. Having a standard way to say that is better. * You can instantiate the base class, which doesn't make sense. * You must use testing to

Re: The Industry choice

2004-12-31 Thread Christopher Koppler
On Fri, 31 Dec 2004 03:49:44 -0800, Paul Rubin wrote: Christopher Koppler [EMAIL PROTECTED] writes: The moral is, of course, that either the Python community's alpha geeks need to get access to controlling interest in a *major* company (or to become successful enough with their own companies

Re: The Industry choice

2004-12-31 Thread Paul Rubin
Christopher Koppler [EMAIL PROTECTED] writes: IMO (and - indubitably limited - experience) in the many cases where it *would* be an excellent choice, it *is* most often a matter of politics, to have a project use, say C# or Java instead of Python (or Lisp for that matter) as the main

ftplib strange behaviour

2004-12-31 Thread siggy2
Hi, I'm using Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32 I've noticed a strange (= not deterministic) behaviour of ftplib.py: sometimes (not always) it fails (after a variable number of minutes from 15 to 130) downloading a 150 MB BINARY file (a big gzipped

Re: The Industry choice

2004-12-31 Thread Christopher Koppler
On Fri, 31 Dec 2004 04:03:53 -0800, Paul Rubin wrote: Christopher Koppler [EMAIL PROTECTED] writes: IMO (and - indubitably limited - experience) in the many cases where it *would* be an excellent choice, it *is* most often a matter of politics, to have a project use, say C# or Java instead of

Re: lies about OOP

2004-12-31 Thread TZOTZIOY
On Wed, 15 Dec 2004 17:37:08 -0500, rumours say that Peter Hansen [EMAIL PROTECTED] might have written: Martijn Faassen wrote: Peter Hansen wrote: Well, in any case, thanks for setting the record straight, Martjin. That of course also happens to me once every while. I can take care of

Re: Speed ain't bad

2004-12-31 Thread Reinhold Birkenfeld
Craig Ringer wrote: On Fri, 2004-12-31 at 11:17, Jeremy Bowers wrote: I would point out a couple of other ideas, though you may be aware of them: Compressing all the files seperately, if they are small, may greatly reduce the final compression since similarities between the files can not be

Re: The Industry choice

2004-12-31 Thread Bulba!
On 31 Dec 2004 03:49:44 -0800, Paul Rubin http://[EMAIL PROTECTED] wrote: It's not just a matter of attitude or politics. Python is an excellent choice for many projects. For some other projects, it's clearly unsuitable. For yet other projects, it's a plausible choice but there are sound

Re: The Industry choice

2004-12-31 Thread Peter Dembinski
Paul Rubin http://[EMAIL PROTECTED] writes: [...] I'm involved in a development project for something that's security critical and has to be reliable. The implementation language hasn't been chosen yet. Python and Java are both possibilities. I'm fine with the idea of using Python for

Re: Speed ain't bad

2004-12-31 Thread Bulba!
On Fri, 31 Dec 2004 13:19:44 +0100, Reinhold Birkenfeld [EMAIL PROTECTED] wrote: True; however, it's my understanding that compressing individual files also means that in the case of damage to the archive it is possible to recover the files after the damaged file. This cannot be guaranteed

Re: Speed ain't bad

2004-12-31 Thread Bulba!
On Thu, 30 Dec 2004 22:17:10 -0500, Jeremy Bowers [EMAIL PROTECTED] wrote: I would point out a couple of other ideas, though you may be aware of them: Compressing all the files seperately, if they are small, may greatly reduce the final compression since similarities between the files can not be

ANN: matplotlib-0.70

2004-12-31 Thread John Hunter
matplotlib is a 2D graphics package that produces plots from python scripts, the python shell, or embeds them in your favorite python GUI -- wx, gtk, tk, fltk currently supported with qt in the works. Unlike many python plotting alternatives is written in python, so it is easy to extend.

Re: The Industry choice

2004-12-31 Thread Paul Rubin
Bulba! [EMAIL PROTECTED] writes: OK, so what projects and why would you consider Python: 1. clearly unsuitable An OS kernel, a high-performance signal processing application like a video encoder, or maybe a compact embedded application for an 8-bit microcontroller. Note that you could do

Re: The Industry choice

2004-12-31 Thread Paul Rubin
Peter Dembinski [EMAIL PROTECTED] writes: If it has to be both reliable and secure, I suggest you used more redundant language such as Ada 95. That's something to think about and it's come up in discussions, but probably complicates stuff since it's not currently available on the target

Re: what is lambda used for in real code?

2004-12-31 Thread Diez B. Roggisch
So, those are my thoughts on how lambdas are really used. If others out there have real-life code that uses lambdas in interesting ways, feel free to share them here! I use them in conjunction with metaclasses and properties: def _s_item(self, item): saw::active

Re: Speed ain't bad

2004-12-31 Thread Paul Rubin
Bulba! [EMAIL PROTECTED] writes: The only thing I'm missing in this picture is knowledge if my script could be further optimised (not that I actually need better performance, I'm just curious what possible solutions could be). Any takers among the experienced guys? There's another

Re: Parsing a search string

2004-12-31 Thread Fuzzyman
That's not bad going considering you've only run out of alcohol at 6 in the morning and *then* ask python questions. Anyway - you could write a charcter-by-character parser function that would do that in a few minutes... My 'listquote' module has one - but it splits on commas not whitespace.

Re: The Industry choice

2004-12-31 Thread Christopher Koppler
On Fri, 31 Dec 2004 05:54:05 -0800, Paul Rubin wrote: Bulba! [EMAIL PROTECTED] writes: OK, so what projects and why would you consider Python: 1. clearly unsuitable An OS kernel, a high-performance signal processing application like a video encoder, or maybe a compact embedded

Re: what would you like to see in a 2nd edition Nutshell? A: Unicode aware scrollable message box in Tk

2004-12-31 Thread Pekka Niiranen
Well, I have not read the previous version, but I would like to see an example how to redirect console messages from scripts to Tk windows in UTF-8/16 for debugging purposes. (I hate those ordinal not in range(128) messages) This involves setting font (Arial MS Unicode), scrollbar and Continue

Re: More baby squeaking - iterators in a class

2004-12-31 Thread M.E.Farmer
Reread Russel Blau post he is spot on with his comments: Russel Blau wrote: I don't get that from the passage quoted, at all, although it is somewhat opaque. It says that your __iter__() method must *return an object* with a next() method; your __iter__() method below doesn't return such an

Re: The Industry choice

2004-12-31 Thread Alex Martelli
Christopher Koppler [EMAIL PROTECTED] wrote: ... What makes such companies to choose Java over dynamic, productive languages like Python? Are there any viable, technical reasons for that? ... There is a reason very important to major companies. When you leave that company,

Re: Parsing a search string

2004-12-31 Thread Reinhold Birkenfeld
Freddie wrote: Happy new year! Since I have run out of alcohol, I'll ask a question that I haven't really worked out an answer for yet. Is there an elegant way to turn something like: moo cow farmer john -zug into: ['moo', 'cow', 'farmer john'], ['zug'] I'm trying to parse a

Re: The Industry choice

2004-12-31 Thread Alex Martelli
Christopher Koppler [EMAIL PROTECTED] wrote: The moral is, of course, that either the Python community's alpha geeks need to get access to controlling interest in a *major* company (or to become successful enough with their own companies to register on the current *major* companies radar as

Re: Why are tuples immutable?

2004-12-31 Thread Antoon Pardon
On 2004-12-29, Scott David Daniels [EMAIL PROTECTED] wrote: Antoon Pardon wrote: Op 2004-12-23, Scott David Daniels schreef [EMAIL PROTECTED]: This is half the problem. In the period where an element is in the wrong hash bucket, a new entry for the same value can be created in the proper hash

Re: The Industry choice

2004-12-31 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: Well, Google's market capitalization must be around 50 billion dollars or more, in the range of the top-100 companies, I believe, and they've never kept their Python use a secret. They use Python for a lot of internal tools but their high-volume

RE: The Industry choice

2004-12-31 Thread Walter S. Leipold
Paul Rubin writes: I don't know that C# is really that much different from Python. I haven't used it but I have the impression that it's sort of similar under the skin. Nope nope nope. C# is a statically typed, statically compiled (i.e., no eval(...) or exec(...)), single-inheritance

Re: what would you like to see in a 2nd edition Nutshell?

2004-12-31 Thread JanC
JoeG schreef: I disagree with your Tkinter vs. wxPython decision. I tried a number of programs written with Tkinter and really didn't like the interface. The program I helped develop is Windows based and I knew that a program with the Tkinter interface would never work as a cross platform

Re: More baby squeaking - iterators in a class

2004-12-31 Thread Terry Reedy
Bulba! [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Thanks to everyone for their responses, but it still doesn't work re returning next() method: class R3: def __init__(self, d): self.d=d self.i=len(d) def __iter__(self): d,i = self.d, self.i

Re: what is lambda used for in real code?

2004-12-31 Thread Steven Bethard
Alex Martelli wrote: Steven Bethard [EMAIL PROTECTED] wrote: (2) lambda a: a.lower() My first thought here was to use str.lower instead of the lambda, but of course that doesn't work if 'a' is a unicode object: Right, but string.lower works (after an 'import string'). More generally, maybe it

Re: Parsing a search string

2004-12-31 Thread It's me
I am right in the middle of doing text parsing so I used your example as a mental exercise. :-) Here's a NDFA for your text: b 0 1-9 a-Z , . + - '\n S0: S0 E E S1 E E E S3 E S2 E S1: T1 E E S1 E E E E E E T1 S2: S2 E E S2 E E E E E T2 E S3: T3 E E S3 E E

Re: More baby squeaking - iterators in a class

2004-12-31 Thread M.E.Farmer
Terry Reedy wrote: This is the wrong test for what I and some others thought you were asking. The requirement for p to be an *iterable* and useable in code such as 'for i in p' is that iter(p), not p itself, have a .next method, and iter(p) will. Try ip=iter(p) followed by ip.next and ip.next()

Re: The Industry choice

2004-12-31 Thread beliavsky
Bulba wrote: OK, so what projects and why would you consider Python: 1. clearly unsuitable Large-scale scientific computing projects, such as numerical weather prediction, where performance is critical. Python could be used as the glue but not the guts, where Fortran 95 and C++ are more

Re: what is lambda used for in real code?

2004-12-31 Thread Alex Martelli
Steven Bethard [EMAIL PROTECTED] wrote: (3) self.plural = lambda n: int(n != 1) Note that this is *almost* writable with def syntax. If only we could do: def self.plural(n): int(n != 1) Not sure about the context, but maybe we could use, at class-level:

Re: Parsing a search string

2004-12-31 Thread M.E.Farmer
Ah! that is what the __future__ brings I guess. Damn that progress making me outdated ;) Python 2.2.3 ( a lot of extensions I use are stuck there , so I still use it) M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Probleme mit der Installation der openSource Bittorrent.... python vs JAVA

2004-12-31 Thread JanC
Gerhard Haering schreef: I can understand your emotions here. OTOH it's typical for Germans (and even more so French) to assume that everybody speaks their language. The same is true for English language speakers in my experience... (E.g.: why is this international newsgroup in English only?)

Re: The Industry choice

2004-12-31 Thread Alex Martelli
[EMAIL PROTECTED] wrote: ... array elements. Powers and subtractions in array operations seem to be free in Fortran but very expensive in Python with Numeric. Right, particularly raising to power: a good part of your observations (not all) is accounted for by the fact that Python doesn't

Re: Parsing a search string

2004-12-31 Thread Reinhold Birkenfeld
M.E.Farmer wrote: Ah! that is what the __future__ brings I guess. Damn that progress making me outdated ;) Python 2.2.3 ( a lot of extensions I use are stuck there , so I still use it) I'm also positively surprised how many cute little additions are there every new Python version.

OT: spacing of code in Google Groups

2004-12-31 Thread beliavsky
When I copy code from a source file into a Google Groups message, the indentation is messed up, making my Python code illegal and all my code ugly. Are there tricks to avoid this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 30)

2004-12-31 Thread Alex Martelli
Cameron Laird [EMAIL PROTECTED] wrote: ... Yippee! The martellibot promises to explain Unicode for Pythoneers. http://groups-beta.google.com/group/comp.lang.python/msg/6015a5a05c206712 Uh -- _did_ I? Eeep... I guess I did... mostly, I was pointing to Holger Krekel's very nice recipe (not

Re: Mixing metaclasses and exceptions

2004-12-31 Thread Alex Martelli
Phillip J. Eby [EMAIL PROTECTED] wrote: Jp Calderone wrote: I'd skip that, though. Your problem doesn't sound Metaclass! at me. I wonder if you could elaborate on your usage? Perhaps there's a better solution which doesn't involve metaclasses at all. I suspect he could *maybe* get

Re: Securing a future for anonymous functions in Python

2004-12-31 Thread Steven Bethard
Alex Martelli wrote: Paul L. Du Bois [EMAIL PROTECTED] wrote: def fn(gen): Turns a generator expression into a callable. def anonymous(*args): return gen.next() return anonymous def args(): Works with fn(); yields args passed to anonymous(). while True: yield

Re: Securing a future for anonymous functions in Python

2004-12-31 Thread Scott David Daniels
David Bolen wrote: So for example, an asynchronous sequence of operations might be like: d = some_deferred_function() d.addCallback(lambda x: next_function()) d.addCallback(lambda blah: third_function(otherargs, blah)) d.addCallback(lambda x: last_function()) which to me is more

Re: Securing a future for anonymous functions in Python

2004-12-31 Thread Alex Martelli
Steven Bethard [EMAIL PROTECTED] wrote: Does that seem about right? Yep! P.S. That's so *evilly* cool! We should have an Evilly Cool Hack of the Year, and I nominate Paul du Bois's one as the winner for 2004. Do I hear any second...? Alex --

Re: Securing a future for anonymous functions in Python

2004-12-31 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: We should have an Evilly Cool Hack of the Year, and I nominate Paul du Bois's one as the winner for 2004. Do I hear any second...? The year's not over yet :). -- http://mail.python.org/mailman/listinfo/python-list

Re: Securing a future for anonymous functions in Python

2004-12-31 Thread Ian Bicking
David Bolen wrote: Ian Bicking [EMAIL PROTECTED] writes: The one motivation I can see for function expressions is callback-oriented programming, like: get_web_page(url, when_retrieved={page | give_page_to_other_object(munge_page(page))}) This is my primary use case for lambda's

Re: Securing a future for anonymous functions in Python

2004-12-31 Thread David Bolen
Scott David Daniels [EMAIL PROTECTED] writes: David Bolen wrote: So for example, an asynchronous sequence of operations might be like: d = some_deferred_function() d.addCallback(lambda x: next_function()) d.addCallback(lambda blah: third_function(otherargs, blah))

Re: Securing a future for anonymous functions in Python

2004-12-31 Thread Scott David Daniels
David Bolen wrote: Scott David Daniels [EMAIL PROTECTED] writes: while test() != False: ...code... I'm not sure I follow the error in this snippet... The code is fat -- clearer is: while test(): ...code... The right sequence using lambda is: d =

Re: Parsing a search string

2004-12-31 Thread It's me
Andrew Dalke [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] It's me wrote: Here's a NDFA for your text: b 0 1-9 a-Z , . + - '\n S0: S0 E E S1 E E E S3 E S2 E S1: T1 E E S1 E E E E E E T1 S2: S2 E E S2 E E E E E T2 E S3: T3 E E S3 E

Re: Parsing a search string

2004-12-31 Thread Brian Beck
Freddie wrote: I'm trying to parse a search string so I can use it for SQL WHERE constraints, preferably without horrifying regular expressions. Uhh yeah. If you're interested, I've written a function that parses query strings using a customizable version of Google's search syntax. Features

Re: Parsing a search string

2004-12-31 Thread John Machin
Andrew Dalke wrote: It's me wrote: Here's a NDFA for your text: b 0 1-9 a-Z , . + - '\n S0: S0 E E S1 E E E S3 E S2 E S1: T1 E E S1 E E E E E E T1 S2: S2 E E S2 E E E E E T2 E S3: T3 E E S3 E E E E E E T3 Now if I only had an NDFA for

Re: The Industry choice

2004-12-31 Thread Cameron Laird
In article [EMAIL PROTECTED], Paul Rubin http://[EMAIL PROTECTED] wrote: Peter Dembinski [EMAIL PROTECTED] writes: If it has to be both reliable and secure, I suggest you used more redundant language such as Ada 95. That's something to think about and it's come up in discussions, but probably

Re: The Industry choice

2004-12-31 Thread Cameron Laird
In article [EMAIL PROTECTED], Christopher Koppler [EMAIL PROTECTED] wrote: . . . Manager culture is still very much mired in rituals that may in one form or another go back to hunter-gatherer days (or maybe even further);

Re : Upgrade woes: Numeric, gnuplot, and Python 2.4

2004-12-31 Thread Cedric
This is a 3 weeks old problem, but having found a solution (and having looked for one here, finding only this message), I'm replying now. From: Jive ([EMAIL PROTECTED]) Subject: Upgrade woes: Numeric, gnuplot, and Python 2.4 Date: 2004-12-11 18:45:10 PST Here's my sitch: I use gnuplot.py at

Re: pyUnitPerf

2004-12-31 Thread Peter Hansen
Dieter Maurer wrote: We use pyUnit extensively and are mostly satisfied. There is one essential problem we hit more often: setting up and tearing down can take excessive time. Often, we are forced to abandon the test independence and let a complete set of tests share the main part of the fixture.

Re: OT: spacing of code in Google Groups

2004-12-31 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: When I copy code from a source file into a Google Groups message, the indentation is messed up, making my Python code illegal and all my code ugly. Are there tricks to avoid this? Try putting a # at the start of every line. Everyone should understand what you mean (and

Re: The Industry choice

2004-12-31 Thread Hans Nowak
Paul Rubin wrote: You should write unit tests either way, but in Python you're relying on the tests to find stuff that the compiler finds for you with Java. As I wrote on my weblog a while ago, I suspect that this effect is largely psychological. You jump through hoops, declaring types all over

Re: OT: spacing of code in Google Groups

2004-12-31 Thread Grant Edwards
On 2004-12-31, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: When I copy code from a source file into a Google Groups message, the indentation is messed up, making my Python code illegal and all my code ugly. Are there tricks to avoid this? Try putting a # at the start

Re: OT: spacing of code in Google Groups

2004-12-31 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: When I copy code from a source file into a Google Groups message, the indentation is messed up, making my Python code illegal and all my code ugly. Are there tricks to avoid this? Try putting a # at the start of every line. Everyone

Of closures and expressing anonymous functions [Was: Re: Securing a future for anonymous functions in Python]

2004-12-31 Thread Simo Melenius
[EMAIL PROTECTED] (Bengt Richter) writes: Closure is the name for the whole thing, apparently, not just the environment the procedure body needs, which was the aspect that I (mis)attached the name to. Which brings me to the point where I'd welcome more flexibility in writing to variables

Re: Parsing a search string

2004-12-31 Thread It's me
John Machin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Andrew Dalke wrote: It's me wrote: Here's a NDFA for your text: b 0 1-9 a-Z , . + - '\n S0: S0 E E S1 E E E S3 E S2 E S1: T1 E E S1 E E E E E E T1 S2: S2 E E S2 E E E E E

Re: PyQT installation

2004-12-31 Thread Brian
For those curious about Trolltech's stance on Windows, here's what Trolltech's License FAQ - Open Source Edition ( http://www.trolltech.com/developer/faqs/license_gpl.html ) has to say: Why is there no Open Source (GNU GPL) version of Qt on Windows ? We have regrettably not found a way of

Re: Securing a future for anonymous functions in Python

2004-12-31 Thread Simo Melenius
Ian Bicking [EMAIL PROTECTED] writes: But I do think there's other ways to approach this. Function expressions could get really out of hand, IMHO, and could easily lead to twenty-line expressions. That's aesthetically incompatible with Python source, IMHO. You can already write unaesthetic

Re: The Industry choice

2004-12-31 Thread Steve Holden
Cameron Laird wrote: In article [EMAIL PROTECTED], Christopher Koppler [EMAIL PROTECTED] wrote: . . . Manager culture is still very much mired in rituals that may in one form or another go back to hunter-gatherer days (or

PyCon submission about to close

2004-12-31 Thread Steve Holden
Just a quick reminder for the laggards among us that you now have approximately SEVEN HOURS in which to submit your proposals for a talk at PyCon. Thanks to all who have already taken the trouble to do so, and to the rest of you: GET ON WITH IT! happy-new-year-ly y'rs - steve -- Steve Holden

Re: what is lambda used for in real code?

2004-12-31 Thread Adam DePrince
On Fri, 2004-12-31 at 01:53, Steven Bethard wrote: I thought it might be useful to put the recent lambda threads into perspective a bit. I was wondering what lambda gets used for in real code, so I grepped my Python Lib directory. Here are some of the ones I looked, classified by how I

Quoting code [was: OT: spacing of code in Google Groups]

2004-12-31 Thread Steve Holden
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: When I copy code from a source file into a Google Groups message, the indentation is messed up, making my Python code illegal and all my code ugly. Are there tricks to avoid this? Try putting a # at the start of every line.

Re: OT: spacing of code in Google Groups

2004-12-31 Thread Adam DePrince
On Fri, 2004-12-31 at 13:03, [EMAIL PROTECTED] wrote: When I copy code from a source file into a Google Groups message, the indentation is messed up, making my Python code illegal and all my code ugly. Are there tricks to avoid this? Subscribe to the python-list@python.org mailing list. Take

Re: Securing a future for anonymous functions in Python

2004-12-31 Thread Steven Bethard
Simo Melenius wrote: map (def x: if foo (x): return baz_1 (x) elif bar (x): return baz_2 (x) else: global hab hab.append (x) return baz_3 (hab), [1,2,3,4,5,6]) I think this would probably have to be

Re: The Industry choice

2004-12-31 Thread Mike Meyer
[EMAIL PROTECTED] (Cameron Laird) writes: For a not-too-different variety of safety, I like Eiffel. Again, Eiffel compilers are available nearly, but not entirely, everywhere. Eiffel compilers tend to generate C code, and hence work on anything with a C compiler. The question then becomes how

Re: what is lambda used for in real code?

2004-12-31 Thread Steven Bethard
Adam DePrince wrote: Lets not forget the real reason for lambda ... the elegance of orthogonality. Why treat functions differently than any other object? We can operate on every other class without having to involve the namespace, why should functions be any different? Yup. I think in most of

Re: what is lambda used for in real code?

2004-12-31 Thread Hans Nowak
Adam DePrince wrote: In sort, we must preserve the ability to create an anonymous function simply because we can do so for every other object type, and functions are not special enough to permit this special case. Your reasoning makes sense... lambda enables you to create a function as part of an

Zope newsgroups? Need help with POSKeyError

2004-12-31 Thread Bob Horvath
I have a Zope/Plone combination that I have been having POSKeyErrors with for a while now. Are there any newsgroups that deal with Zope? -- http://mail.python.org/mailman/listinfo/python-list

Re: what is lambda used for in real code?

2004-12-31 Thread Steven Bethard
Hans Nowak wrote: Adam DePrince wrote: In sort, we must preserve the ability to create an anonymous function simply because we can do so for every other object type, and functions are not special enough to permit this special case. Your reasoning makes sense... lambda enables you to create a

Re: Securing a future for anonymous functions in Python

2004-12-31 Thread Simo Melenius
Steven Bethard [EMAIL PROTECTED] writes: Simo Melenius wrote: map (def x: if foo (x): return baz_1 (x) elif bar (x): return baz_2 (x) else: global hab hab.append (x) return baz_3 (hab),

Re: Securing a future for anonymous functions in Python

2004-12-31 Thread Doug Holton
Steven Bethard wrote: Simo Melenius wrote: map (def x: if foo (x): return baz_1 (x) elif bar (x): return baz_2 (x) else: global hab hab.append (x) return baz_3 (hab), [1,2,3,4,5,6]) I think this would

Re: Zope newsgroups? Need help with POSKeyError

2004-12-31 Thread richard
Bob Horvath wrote: I have a Zope/Plone combination that I have been having POSKeyErrors with for a while now. Are there any newsgroups that deal with Zope? No, but there is a mailing list - see zope.org Also, try google searching for POSKeyError. Richard --

Re: what is lambda used for in real code?

2004-12-31 Thread Alex Martelli
Steven Bethard [EMAIL PROTECTED] wrote: ... Your reasoning makes sense... lambda enables you to create a function as part of an expression, just like other types can be part of an expression. However, by that same reasoning, maybe classes aren't special enough either to warrant a

Re: what is lambda used for in real code?

2004-12-31 Thread Reinhold Birkenfeld
Adam DePrince wrote: So, those are my thoughts on how lambdas are really used. If others out there have real-life code that uses lambdas in interesting ways, feel free to share them here! Lets not forget the real reason for lambda ... I really hoped you would point out the _real_

exposing C array to python namespace: NumPy and array module.

2004-12-31 Thread Bo Peng
Dear list, I am writing a Python extension module that needs a way to expose pieces of a big C array to python. Currently, I am using NumPy like the following: PyObject* res = PyArray_FromDimsAndData(1, int*dim, PyArray_DOUBLE, char*buf); Users will get a Numeric Array object and can change

Re: Parsing a search string

2004-12-31 Thread Freddie
Reinhold Birkenfeld wrote: Freddie wrote: Happy new year! Since I have run out of alcohol, I'll ask a question that I haven't really worked out an answer for yet. Is there an elegant way to turn something like: moo cow farmer john -zug into: ['moo', 'cow', 'farmer john'], ['zug'] I'm trying to

Re: More baby squeaking - iterators in a class

2004-12-31 Thread Terry Reedy
M.E.Farmer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Terry Reedy wrote: will. Try ip=iter(p) followed by ip.next and ip.next() instead. Does that mean if you dont't call iter(() on your instance or have a next() method you can't do this: p=R3('eggs') for i in p: print

Re: More baby squeaking - iterators in a class

2004-12-31 Thread M.E.Farmer
Terry , Thank you for the explanation . That is much clearer now, I have played a bit with generators but have never tried to create a custom iterator. I am just now getting into the internals part of python objects... this langauage is still amazing to me! The reason I asked the question was

Re: pygame + py2exe = bad exe. why?

2004-12-31 Thread M.E.Farmer
Erik Bethke wrote: # setup.py from distutils.core import setup import py2exe setup(console=[myscript.py]) # python setup.py py2exe -Knio Erik glad to see you were able to track it down. Have you been succesful in making the changes they mentioned? M.E.Farmer --

Re: what is lambda used for in real code?

2004-12-31 Thread Terry Reedy
Adam DePrince [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] In sort, we must preserve the ability to create an anonymous function simply because we can do so for every other object type, and functions are not special enough to permit this special case. Please show me how to

  1   2   >