PyDev 0.9.8.6 released

2006-01-10 Thread Fabio Zadrozny
Hi All, PyDev - Python IDE (Python Development Enviroment for Eclipse) version 0.9.8.6 has been released. Check the homepage (http://pydev.sourceforge.net/) for more details. Details for Release: 0.9.8.6: Major highlights: --- * Added a new 'Pydev project' wizard (Mikko

[ANN] astng 0.14

2006-01-10 Thread Sylvain Thénault
Hi ! I'm pleased to announce the new 0.14 version of astng. This release mainly provides some major internal and api changes to have a richer model and a start for static inference on ast nodes. What's new ? * some major inference improvments and refactoring ! The drawback is

ANN: MoinMoin 1.5.0 (advanced wiki engine) released

2006-01-10 Thread Alexander Schremmer
__ /\/\ ___ (_)_ __ /\/\ ___ (_)_ __ /\ / _ \| | '_ \ /\ / _ \| | '_ \ __ / /\/\ \ (_) | | | | / /\/\ \ (_) | | | | | /| |_ \/\/\___/|_|_| |_\/\/\___/|_|_| |_| |.__)

[ANN] logilab-common 0.13

2006-01-10 Thread Sylvain Thénault
Hi ! I'm pleased to announce the 0.13 new release of the logilab-common package. This release provides some bug fixes and minor enhancements and api changes which shouldn't break backward compatibility, so users are strongly encouraged to update. What's new ? * testlib: ability

[ANN] APyCoT 0.8

2006-01-10 Thread Sylvain Thénault
Hi ! I'm pleased to announce the new 0.8 release of the APyCoT package. This release provides some new minor functionnalities. What's new ? * use package's pylintrc if a file named pylintrc is found under the checked out directory (implements #10177) * ${TESTDIR} in

Re: Help wanted with md2 hash algorithm

2006-01-10 Thread wjb131
Paul Rubin wrote: [EMAIL PROTECTED] writes: I thought I had build a proper implementation in Python. The error you mention can be avoided by studying the C implementation in RFC 1319. BUT: Some of the test vectors failed. That's my problem ;-( And therefore I asked for help. You might

Re: string to datetime parser?

2006-01-10 Thread Tim Roberts
beza1e1 [EMAIL PROTECTED] wrote: Is there a library which can parse strings and output a datetime object? It should be as magical as possible and allow things like: 12:30 tomorrow 10.10.2005 02-28-00 28/03/95 And given 10/03/95, is that a date in mid-March, or in early October? -- - Tim

Re: itertools.izip brokeness

2006-01-10 Thread Antoon Pardon
Op 2006-01-10, Bengt Richter schreef [EMAIL PROTECTED]: On 9 Jan 2006 08:19:21 GMT, Antoon Pardon [EMAIL PROTECTED] wrote: Op 2006-01-05, Bengt Richter schreef [EMAIL PROTECTED]: On 5 Jan 2006 15:48:26 GMT, Antoon Pardon [EMAIL PROTECTED] wrote: [...] But you can fix that (only test is what

Re: Spelling mistakes!

2006-01-10 Thread Antoon Pardon
Op 2006-01-09, Xavier Morel schreef [EMAIL PROTECTED]: Antoon Pardon wrote: I don't think unit tests are that helpful in this case. Unit tests help you in finding out there is a bug, they don't help that much in tracking down a bug. I for some reason a person is reading over the difference

Re: testing units in a specific order?

2006-01-10 Thread Antoon Pardon
Op 2006-01-09, Tim Peters schreef [EMAIL PROTECTED]: [Antoon Pardon] I have used unit tests now for a number of project. One thing that I dislike is it that the order in which the tests are done bears no relationship to the order they appear in the source. This makes using unit

Re: Do you have real-world use cases for map's None fill-in feature?

2006-01-10 Thread Raymond Hettinger
[Bengt Richter] What about some semantics like my izip2 in http://groups.google.com/group/comp.lang.python/msg/3e9eb63a1ddb1f46?hl=en (which doesn't even need a separate name, since it would be backwards compatible) Also, what about factoring sequence-related stuff into being methods

[ANN] IPython 0.7.0

2006-01-10 Thread Fernando Perez
Hi all, After a long hiatus (0.6.15 was out in June of 2005), I'm glad to announce the release of IPython 0.7.0, with lots of new features. WHAT is IPython? 1. An interactive shell superior to Python's default. IPython has many features for object introspection, system shell

Re: Failing unittest Test cases

2006-01-10 Thread Frank Niessink
Scott David Daniels wrote: There has been a bit of discussion about a way of providing test cases in a test suite that _should_ work but don't. One of the rules has been the test suite should be runnable and silent at every checkin. Recently there was a checkin of a test that _should_ work

Re: PyQt calling an external app?

2006-01-10 Thread Giovanni Bajo
gregarican wrote: What's the easiest and cleanest way of having PyQt bring up an external application? You can also go the Qt way and use QProcess. This also gives you cross-platform communication and process killing capabilities which are pretty hard to obtain (see the mess in Python with

Re: Do you have real-world use cases for map's None fill-in feature?

2006-01-10 Thread Raymond Hettinger
[Raymond Hettinger] I am evaluating a request for an alternate version of itertools.izip() that has a None fill-in feature like the built-in map function: map(None, 'abc', '12345') # demonstrate map's None fill-in feature [Paul Rubin] I think finding different ways to write it was an

Re: Detecting Python Installs from the Windows Registry

2006-01-10 Thread Fuzzyman
Great, I'll work with this. Thanks Fuzzyman http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't import Tkinter module.

2006-01-10 Thread Martin Franklin
slomo wrote: I'm working on linux Fedora Core 3 with Python 2.3. I can't from Tkinter import * . And see only No modlue named Tkiner error. Of course I have tk/tcl 8.4. They works perfectly. Certainly, I don't have Tkinter module for Python. What should I do for it as I'm not a root? as

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Giovanni Bajo
Mike Meyer wrote: My question is, what reasons are left for leaving the current default equality operator for Py3K, not counting backwards-compatibility? (assume that you have idset and iddict, so explicitness' cost is only two characters, in Guido's example) Yes. Searching for items in

Re: Do you have real-world use cases for map's None fill-in feature?

2006-01-10 Thread Paul Rubin
Raymond Hettinger [EMAIL PROTECTED] writes: iterator = check_empty(iterator) There are so many varieties of iterator that it's probably not workable to alter the iterator API for all of the them. In any case, a broad API change like this would need its own PEP. The hope was that it

Re: How to create a script that list itself ?

2006-01-10 Thread Duncan Booth
Dave Hansen wrote: Stealing from the old C chestnut: s=s=%c%s%c;print s%%(34,s,34);print s%(34,s,34) Or a bit shorter: s='s=%s;print s%%`s`';print s%`s` -- http://mail.python.org/mailman/listinfo/python-list

Re: Failing unittest Test cases

2006-01-10 Thread Paul Rubin
Scott David Daniels [EMAIL PROTECTED] writes: Recently there was a checkin of a test that _should_ work but doesn't. The discussion got around to means of indicating such tests (because the effort of creating a test should be captured) without disturbing the development flow. Do you mean

Re: Real-world use cases for map's None fill-in feature?

2006-01-10 Thread Peter Otten
Raymond Hettinger wrote: Alternately, the need can be met with existing tools by pre-padding the iterator with enough extra values to fill any holes: it = chain(iterable, repeat('', group_size-1)) result = izip_longest(*[it]*group_size) Both approaches require a certain meaure of

Re: Failing unittest Test cases

2006-01-10 Thread Peter Otten
Scott David Daniels wrote: There has been a bit of discussion about a way of providing test cases in a test suite that should work but don't.  One of the rules has been the test suite should be runnable and silent at every checkin.  Recently there was a checkin of a test that should work but

Re: Failing unittest Test cases

2006-01-10 Thread Fredrik Lundh
Paul Rubin wrote: Recently there was a checkin of a test that _should_ work but doesn't. The discussion got around to means of indicating such tests (because the effort of creating a test should be captured) without disturbing the development flow. Do you mean shouldn't work but does?

Re: email modules and attachments that aren't there

2006-01-10 Thread Russell Bungay
Hello, main_msg['Content-type'] = 'Multipart/mixed' Would it be the 'Content-Type' header? I've no expertise in this, but doesn't 'multipart' mean 'has attachments'? Brilliant, thank you. A swift test on the number of attachments and changing the header suitably does the job. Thank

Re: Failing unittest Test cases

2006-01-10 Thread Duncan Booth
Scott David Daniels wrote: There has been a bit of discussion about a way of providing test cases in a test suite that _should_ work but don't. One of the rules has been the test suite should be runnable and silent at every checkin. Recently there was a checkin of a test that _should_ work

Re: Unicode Pythonwin / win32 / console?

2006-01-10 Thread Robert
Martin v. Löwis schrieb: Robert wrote: I'm using Pythonwin and py2.3 (py2.4). I did not come clear with this: I want to use win32-fuctions like win32ui.MessageBox, listctrl.InsertItem . to get unicode strings on the screen - best results according to the platform/language settings

Re: Implementing Tuples with Named Items

2006-01-10 Thread Peter Otten
Bryan wrote: in the python cookbook 2nd edition, section 6.7 (page 250-251), there a problem for implementing tuples with named items. i'm having trouble understanding how one of commands work and hope someone here can explain what exactly is going on. without copying all the code here,

Re: csv format to DBase III format

2006-01-10 Thread William
Peter Otten wrote: William wrote: Peter Otten wrote: [EMAIL PROTECTED] wrote: I need to transfer csv format file to DBase III format file. How do i do it in Python language? http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362715 I create a dbf file, it can be opened

Re: Failing unittest Test cases

2006-01-10 Thread Paul Rubin
Fredrik Lundh [EMAIL PROTECTED] writes: no, he means exactly what he said: support for expected failures makes it possible to add test cases for open bugs to the test suite, without 1) new bugs getting lost in the noise, and 2) having to re- write the test once you've gotten around to fix the

Re: Failing unittest Test cases

2006-01-10 Thread Duncan Booth
Peter Otten wrote: Marking a unittest as should fail in the test suite seems just wrong to me, whatever the implementation details may be. If at all, I would apply a I know these tests to fail, don't bother me with the messages for now filter further down the chain, in the TestRunner maybe.

Re: email modules and attachments that aren't there

2006-01-10 Thread Russell Bungay
Hello, main_msg['Content-type'] = 'Multipart/mixed' Would it be the 'Content-Type' header? I've no expertise in this, but doesn't 'multipart' mean 'has attachments'? Brilliant, thank you. A swift test on the number of attachments and changing the header suitably does the job. That

Re: email modules and attachments that aren't there

2006-01-10 Thread Russell Bungay
Russell Bungay wrote: for attachment in attachments: snip contents of for loop sub_msg = email.Message.Message() sub_msg.add_header('Content-type', content_type, name=attachment) sub_msg.add_header('Content-transfer-encoding', cte)

Re: Failing unittest Test cases

2006-01-10 Thread Fredrik Lundh
Paul Rubin wrote: no, he means exactly what he said: support for expected failures makes it possible to add test cases for open bugs to the test suite, without 1) new bugs getting lost in the noise, and 2) having to re- write the test once you've gotten around to fix the bug. Oh I see,

Re: Marshaling unicode WDDX

2006-01-10 Thread isthar
Ok. but how I suppose to use them. I am currently using marshaller indirectly via wddx.dump(). Anyway, thanks :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Failing unittest Test cases

2006-01-10 Thread Peter Otten
Duncan Booth wrote: Peter Otten wrote: Marking a unittest as should fail in the test suite seems just wrong to me, whatever the implementation details may be. If at all, I would apply a I know these tests to fail, don't bother me with the messages for now filter further down the chain, in

Re: Failing unittest Test cases

2006-01-10 Thread Michele Simionato
Scott David Daniels about marking expected failures: snip I am +1, I have wanted this feature for a long time. FWIW, I am also +1 to run the tests in the code order. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Printing Python Postscript

2006-01-10 Thread marcobonifazi
Hello! After a Opengl 2 Postscript conversion, I want to print my ps files to a plotter. My intents are to read istantaneous characteristics of the plotter, for example the kind of paper it has at a moment, ecc. Is there any python module/extension to interface my program to the printer

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Antoon Pardon
Op 2006-01-10, Mike Meyer schreef [EMAIL PROTECTED]: [EMAIL PROTECTED] writes: My question is, what reasons are left for leaving the current default equality operator for Py3K, not counting backwards-compatibility? (assume that you have idset and iddict, so explicitness' cost is only two

Re: Real-world use cases for map's None fill-in feature?

2006-01-10 Thread Raymond Hettinger
[Raymond] Both approaches require a certain measure of inventiveness, rely on advanced tricks, and forgo readability to gain the raw speed and conciseness afforded by a clever use of itertools. They are also a challenge to review, test, modify, read, or explain to others. [Peter Otten]

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-10 Thread Armin Rigo
Hi Alex, On Mon, 9 Jan 2006, Alex Martelli wrote: 50%, yes (the other 50% must come from private contributions, that's a EU rule for research projects). It used to be thought that some of the EU money could be used to help pay for sprint participants' travel expenses, but apparently

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-10 Thread Armin Rigo
Hi Alex, On Mon, 9 Jan 2006, Alex Martelli wrote: 50%, yes (the other 50% must come from private contributions, that's a EU rule for research projects). It used to be thought that some of the EU money could be used to help pay for sprint participants' travel expenses, but apparently

Re: Calling foreign functions from Python? ctypes?

2006-01-10 Thread Thomas Heller
Delaney, Timothy (Tim) [EMAIL PROTECTED] writes: Thomas Heller wrote: As the author, I would be happy to see ctypes included with the standard Python build. I'm sure you know the magical incantation to get that to happen ... 1. Propose it on python-dev. 2. Commit to maintain it in the

PyDev 0.9.8.6 released

2006-01-10 Thread Fabio Zadrozny
Hi All, PyDev - Python IDE (Python Development Enviroment for Eclipse) version 0.9.8.6 has been released. Check the homepage (http://pydev.sourceforge.net/) for more details. Details for Release: 0.9.8.6: Major highlights: --- * Added a new 'Pydev project' wizard (Mikko

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Mike Meyer
Antoon Pardon [EMAIL PROTECTED] writes: Yes. Searching for items in heterogenous containers. With your change in place, the in operator becomes pretty much worthless on containers of heterogenous objects. Ditto for container methods that do searches for equal members. Whenever you compare two

Re: Apology Re: Is 'everything' a refrence or isn't it?

2006-01-10 Thread Ben Sizer
Alex Martelli wrote: Ben Sizer [EMAIL PROTECTED] wrote: ... assignment semantics that differ from languages such as C++ and Java, not the calling mechanism. In C++, assignment means copying a value. In Python, assignment means reassigning a reference. And in Java, it means just the

AW: Calling foreign functions from Python? ctypes?

2006-01-10 Thread Gerald Klix
I read the whol email thread carefully and could not find any sentence by Guido, which states that he does not accept ctypes for the standard library. He just declined to rewrite winreg. Did I miss something? Cya, Gerald -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL

syntax error

2006-01-10 Thread Sheldon
Hi Everyone, I am new here but I am pretty good at python programming but I am not exert. I have been away from programming for about a year and now I am programming in python again in combination with IDL. I came across a error that puzzles me and I need some help. It is pretty simple error but

try: except never:

2006-01-10 Thread Hallvard B Furuseth
I'd like an 'except exception which is never raised' statement Is there a defined way to do that, for Python 2.2 and above? 'except None:' works for now, but I don't know if that's safe: for ex in ZeroDivisionError, None: try: 1/0 except ex: print

Re: syntax error

2006-01-10 Thread Rod Furey
Sheldon wrote: SyntaxError: invalid syntax Now I know that there is no synthax error with that line of code. I have also checked for indentations errors. I think that the error is something else. Can anyone point me in the right direction? What triggers such erroneous errors in Python?

Re: try: except never:

2006-01-10 Thread Paul Rubin
Hallvard B Furuseth [EMAIL PROTECTED] writes: 'except None:' works for now, but I don't know if that's safe: for ex in ZeroDivisionError, None: try: 1/0 except ex: print Ignored first exception. class NeverRaised(Exception): pass for ex in

Re: syntax error

2006-01-10 Thread Fredrik Lundh
Sheldon wrote: I am new here but I am pretty good at python programming but I am not exert. I have been away from programming for about a year and now I am programming in python again in combination with IDL. I came across a error that puzzles me and I need some help. It is pretty simple

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Antoon Pardon
Op 2006-01-10, Mike Meyer schreef [EMAIL PROTECTED]: Antoon Pardon [EMAIL PROTECTED] writes: You could fix this by patching all the appropriate methods. But then how do you describe their behavior, without making some people expect that it will raise an exception if they pass it incomparable

Re: syntax error

2006-01-10 Thread Sheldon
Hi Rod, This sounds very interesting. I am checking the previous lines and will get back to you. Thanks, Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: try: except never:

2006-01-10 Thread Hallvard B Furuseth
Paul Rubin writes: Hallvard B Furuseth [EMAIL PROTECTED] writes: 'except None:' works for now, but I don't know if that's safe: for ex in ZeroDivisionError, None: try: 1/0 except ex: print Ignored first exception. class NeverRaised(Exception):

Re: syntax error

2006-01-10 Thread Sheldon
Hi Rod, You were right. The error was on the previous line. I will remember that. Thanks for your help! Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Fuzzyman
On 9 Jan 2006 14:40:45 -0800, [EMAIL PROTECTED] wrote: Hello, Guido has decided, in python-dev, that in Py3K the id-based order comparisons will be dropped. This means that, for example, {} [] will raise a TypeError instead of the current behaviour, which is returning a value which is, really,

Re: Mysterious non-module A.sys

2006-01-10 Thread Fredrik Lundh
Robin Becker wrote: I have a package A containing a null __init__.py and a simple module B.py C:\codecat A\B.py import sys print __file__ print sys.modules.keys() C:\codepython -cimport A.B A\B.py ['copy_reg', 'A.B', 'locale', '__main__', 'site', '__builtin__', 'encodings', 'os.path',

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Antoon Pardon
Op 2006-01-10, Fuzzyman schreef [EMAIL PROTECTED]: On 9 Jan 2006 14:40:45 -0800, [EMAIL PROTECTED] wrote: Hello, Guido has decided, in python-dev, that in Py3K the id-based order comparisons will be dropped. This means that, for example, {} [] will raise a TypeError instead of the current

Re: try: except never:

2006-01-10 Thread Paul Rubin
Hallvard B Furuseth [EMAIL PROTECTED] writes: class NeverRaised(Exception): pass for ex in ZeroDivisionError, NeverRaised: Heh. Simple enough. Unless some obstinate person raises it anyway... Hmm, ok, how's this?: def NeverRaised(): class blorp(Exception): pass return blorp

Encoding - unicode

2006-01-10 Thread Robert Deskoski
Hi there, Currently I have a file with germanic names which are, unfortunately in this format: B\xf6genschutz As well as being mixed with those who actually have the correct character's in them. What I am trying to do is convert the characters in the above format to the correct format in a text

Re: PyQt calling an external app?

2006-01-10 Thread gregarican
Giovanni Bajo wrote: You can also go the Qt way and use QProcess. This also gives you cross-platform communication and process killing capabilities which are pretty hard to obtain (see the mess in Python with popen[1234]/subprocess). You also get nice signals from the process which

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Peter Decker
On 10 Jan 2006 13:33:20 GMT, Antoon Pardon [EMAIL PROTECTED] wrote: IMO if they aren't of the same type then the answer to: a b is just as obviously False as a == b Yet how things are proposed now, the first will throw an exception and the latter will return False. I don't see the

Re: syntax error

2006-01-10 Thread Sheldon
Hi Fredrik, I am using python 2.3.3 I am checking now the previous lines for errors. Thanks, Sheldon -- http://mail.python.org/mailman/listinfo/python-list

XMLBooster 2.10.1 supports Python

2006-01-10 Thread Darius Blasband
* XMLBooster 2.10.1 supports Python * XMLBooster (http://www.xmlbooster.com) version 2.10.1 can generate application-specific XML parsers to be used from within Python. The parsers and the resulting data structures can be accessed by

Mysterious non-module A.sys

2006-01-10 Thread Robin Becker
I have a package A containing a null __init__.py and a simple module B.py C:\codecat A\B.py import sys print __file__ print sys.modules.keys() C:\codepython -cimport A.B A\B.py ['copy_reg', 'A.B', 'locale', '__main__', 'site', '__builtin__', 'encodings', 'os.path', 'A.sys', 'encodings.codecs',

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Antoon Pardon
Op 2006-01-10, Peter Decker schreef [EMAIL PROTECTED]: On 10 Jan 2006 13:33:20 GMT, Antoon Pardon [EMAIL PROTECTED] wrote: IMO if they aren't of the same type then the answer to: a b is just as obviously False as a == b Yet how things are proposed now, the first will throw an

Re: try: except never:

2006-01-10 Thread Duncan Booth
Paul Rubin wrote: Hallvard B Furuseth [EMAIL PROTECTED] writes: class NeverRaised(Exception): pass for ex in ZeroDivisionError, NeverRaised: Heh. Simple enough. Unless some obstinate person raises it anyway... Hmm, ok, how's this?: def NeverRaised(): class

Client side web programming

2006-01-10 Thread Pramod Subramanyan
Hi, Well the trouble is that my orkut scrapbook is flooded. So I reckoned that I'd write some sort of a script to delete the 14800 or so scraps. Now the big problem is that I don't really have too much knowledge about web programming. I have a rough idea about HTTP, HTTPS, cookies etc. but I

Re: Failing unittest Test cases

2006-01-10 Thread Roy Smith
Peter Otten [EMAIL PROTECTED] wrote: You're right of course. I still think the currently doesn't pass marker doesn't belong into the test source. The agile people would say that if a test doesn't pass, you make fixing it your top priority. In an environment like that, there's no such thing as

Re: Removing Duplicate entries in a file...

2006-01-10 Thread sri2097
Thanx Mike, My problem solved !! I loaded the entire file contnets into list and my job was a piece of cake after that. Srikar -- http://mail.python.org/mailman/listinfo/python-list

Re: Mysterious non-module A.sys

2006-01-10 Thread Robin Becker
Fredrik Lundh wrote: .. where does A.sys come from? http://www.python.org/doc/essays/packages.html Dummy Entries in sys.modules ... /F ... thanks -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: Client side web programming

2006-01-10 Thread Michele Simionato
Pramod Subramanyan asked aboyt urllib2: Look at this article: http://www.voidspace.org.uk/python/articles/urllib2.shtml Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Efficient mechanism for str.startswith on a set.

2006-01-10 Thread Paul Rubin
Brian Cole [EMAIL PROTECTED] writes: This is obviously the least efficient manner to do this as I'll always be iterating over the entire 'strs'. I know I could make a binary tree out of 'strs' but that's a little more work that don't have time to do today. I know there should be something out

[ANN] astng 0.14

2006-01-10 Thread Sylvain Thénault
Hi ! I'm pleased to announce the new 0.14 version of astng. This release mainly provides some major internal and api changes to have a richer model and a start for static inference on ast nodes. What's new ? * some major inference improvments and refactoring ! The drawback is

[ANN] PyLint 0.9

2006-01-10 Thread Sylvain Thénault
Hi ! I'm very pleased to announce the new 0.9 release of PyLint. This release provides a lot of bug fixes and some new checks and other minor changes. This release depends on the latest astng and logilab-common release (i.e. 0.14 and 0.13 respectivly), so install them before this one. The good

Re: Efficient mechanism for str.startswith on a set.

2006-01-10 Thread Fredrik Lundh
Brian Cole wrote: I need to iterate through a file, checking whether each line 'startswith()' a string that belongs to a set. Normally, the most efficient way I would do this would be: strs=set(['foo','bar']) for line in file: if line.strip() in strs: print line However, for

[ANN] logilab-common 0.13

2006-01-10 Thread Sylvain Thénault
Hi ! I'm pleased to announce the 0.13 new release of the logilab-common package. This release provides some bug fixes and minor enhancements and api changes which shouldn't break backward compatibility, so users are strongly encouraged to update. What's new ? * testlib: ability

[ANN] APyCoT 0.8

2006-01-10 Thread Sylvain Thénault
Hi ! I'm pleased to announce the new 0.8 release of the APyCoT package. This release provides some new minor functionnalities. What's new ? * use package's pylintrc if a file named pylintrc is found under the checked out directory (implements #10177) * ${TESTDIR} in

[ANN] devtools 0.8

2006-01-10 Thread Sylvain Thénault
Hi ! I'm pleased to announce the new 0.8 release of the devtools package. This release provides some bug fixes and major changes into the debian package generation. What's new ? * debianize: * updated to handle site-python installation with architecture

Python and location of .so files?

2006-01-10 Thread Efrat Regev
Hello, On FC4, I've generated an .so file from C++ which I want to use from python. It works when I copy it into /usr/lib/python2.4/site-packages. (I.e., say I have hello.so in that directory, then from the python prompt I can 'import hello', and the code works fine). The problem is that

Re: Do you have real-world use cases for map's None fill-in feature?

2006-01-10 Thread Tim Peters
[Raymond Hettinger] ... I scanned the docs for Haskell, SML, and Perl and found that the norm for map() and zip() is to truncate to the shortest input or raise an exception for unequal input lengths. ... Also, I'm curious as to whether someone has seen a zip fill-in feature employed to good

Efficient mechanism for str.startswith on a set.

2006-01-10 Thread Brian Cole
I need to iterate through a file, checking whether each line 'startswith()' a string that belongs to a set. Normally, the most efficient way I would do this would be: strs=set(['foo','bar']) for line in file: if line.strip() in strs: print line However, for this case I need to do a

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Christopher Subich
Antoon Pardon wrote: Op 2006-01-10, Peter Decker schreef [EMAIL PROTECTED]: I don't see the two comparisons as equivalent at all. If two things are different, it does not follow that they can be ranked. That a b returns false doesn't imply that a and b can be ranked. take sets. set([1,2])

Re: Python and location of .so files?

2006-01-10 Thread Carsten Haese
On Tue, 2006-01-10 at 09:42, Efrat Regev wrote: Hello, On FC4, I've generated an .so file from C++ which I want to use from python. It works when I copy it into /usr/lib/python2.4/site-packages. (I.e., say I have hello.so in that directory, then from the python prompt I can 'import

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Fuzzyman
Peter Decker wrote: On 10 Jan 2006 13:33:20 GMT, Antoon Pardon [EMAIL PROTECTED] wrote: IMO if they aren't of the same type then the answer to: a b is just as obviously False as a == b Yet how things are proposed now, the first will throw an exception and the latter

Regex help needed

2006-01-10 Thread rh0dium
Hi all, I am using python to drive another tool using pexpect. The values which I get back I would like to automatically put into a list if there is more than one return value. They provide me a way to see that the data is in set by parenthesising it. This is all generated as I said using

Re: Do you have real-world use cases for map's None fill-in feature?

2006-01-10 Thread Bengt Richter
On 10 Jan 2006 00:47:36 -0800, Raymond Hettinger [EMAIL PROTECTED] wrote: [Bengt Richter] What about some semantics like my izip2 in http://groups.google.com/group/comp.lang.python/msg/3e9eb63a1ddb1f46?hl=en (which doesn't even need a separate name, since it would be backwards

Re: AW: Calling foreign functions from Python? ctypes?

2006-01-10 Thread Thomas Heller
Gerald Klix [EMAIL PROTECTED] writes: I read the whol email thread carefully and could not find any sentence by Guido, which states that he does not accept ctypes for the standard library. He just declined to rewrite winreg. Did I miss something? Maybe I misinterpreted what he wrote myself.

Re: PIL implementation

2006-01-10 Thread Peter Hansen
arkestra wrote: The error message is -- Syntax error and it highlights the last else statement. You've got incorrect indentation, at least judging by what I see in my newsreader (Thunderbird), which clearly shows the else indented more than the corresponding if. Next time, please cut and

urllib.urlopen and https question

2006-01-10 Thread bowman . joseph
Hi, I'm new to python. I've been handed the job of modifying a script we have here at work that pulls content from a zope site, to create static html. They wanted a check to make sure the database is up, while pulling, to avoid errors. I got it pretty much working how I want without any

Re: - Requesting Comments for Process Definition and Presentation

2006-01-10 Thread Ilias Lazaridis
Gerard Flanagan wrote: Ilias Lazaridis wrote: Ilias Lazaridis wrote: I would like to ask for feedback on the Process Definition and Presentation. snip Your feedback is _very_ important to me. snip ...The prices for our services start at 250,- €. There is a spiritual issue here which I

Re: Client side web programming

2006-01-10 Thread Fuzzyman
And this one for cookie handling: http://www.voidspace.org.uk/python/articles/cookielib.shtml All the best, Fuzzyman -- http://mail.python.org/mailman/listinfo/python-list

Re: Sockets on Windows and Mac

2006-01-10 Thread Peter Hansen
rodmc wrote: I am currently importing the socket library when I write the programs, I have had no problems with it on my PC at work, but the Mac at home steadfastly refuses to work. One rule about asking for help in forums like this is to provide adequate background detail about your

Re: Python and location of .so files?

2006-01-10 Thread Efrat Regev
Carsten Haese wrote: On Tue, 2006-01-10 at 09:42, Efrat Regev wrote: Hello, On FC4, I've generated an .so file from C++ which I want to use from python. It works when I copy it into /usr/lib/python2.4/site-packages. (I.e., say I have hello.so in that directory, then from the python

Re: urllib.urlopen and https question

2006-01-10 Thread [EMAIL PROTECTED]
From the docs for urllib: When performing basic authentication, a FancyURLopener instance calls its prompt_user_passwd() method. The default implementation asks the users for the required information on the controlling terminal. A subclass may override this method to support more appropriate

Re: Get path of a class

2006-01-10 Thread Peter Hansen
Florian Lindner wrote: Hello, how can I get the path of a class. I managed to do it with c.__module__ + . + c.__name__ but I'm sure there is a better way. Please define what you mean by path (and how you hope to make use of this information). Generally a module has a path (i.e. a

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Mike Meyer
Antoon Pardon [EMAIL PROTECTED] writes: There is no way in python now to throw an exception when you think comparing your object to some very different object is just meaningless and using such an object in a container that can be searched via the in operator. I claim that comparing for

Re: Do you have real-world use cases for map's None fill-in feature?

2006-01-10 Thread Szabolcs Nagy
There are so many varieties of iterator that it's probably not workable to alter the iterator API for all of the them. i always wondered if it can be implemented: there are iterators which has length: i = iter([1,2,3]) len(i) 3 now isn't there a way to make this length inheritible? eg.

Re: Do you have real-world use cases for map's None fill-in feature?

2006-01-10 Thread Szabolcs Nagy
There are so many varieties of iterator that it's probably not workable to alter the iterator API for all of the them. i always wondered if it can be implemented: there are iterators which has length: i = iter([1,2,3]) len(i) 3 now isn't there a way to make this length inheritible? eg.

  1   2   3   >