dllimporter -- import dlls for zip archived or frozen applications

2005-05-20 Thread Dieter Maurer
'Dllimporter' is a package to facilitate the import of shared libraries (aka dlls or extension modules) for Python applications running from a zip archive or an executable (a frozen application). The standard Python import mechanism cannot import extension modules being part of a zip archived or

[Ann] DMpdb: improvements and extensions for pdb

2005-08-15 Thread Dieter Maurer
DMpdb is a tiny Python package with improvements and extensions for pdb, Pythons built-in debugger: * the 'where' command gets optional arguments 'number' and 'end' to control the amount of entries printed; its output is made more readable; by defining the method

Re: Embedding a restricted python interpreter

2005-01-17 Thread Dieter Maurer
Paul Rubin http://[EMAIL PROTECTED] writes on 08 Jan 2005 14:56:43 -0800: Dieter Maurer [EMAIL PROTECTED] writes: It uses a specialized compiler that prevents dangerous bytecode operations to be generated and enforces a restricted builtin environment. Does it stop the user from

Re: limited python virtual machine (WAS: Another scripting language implemented into Python itself?)

2005-01-27 Thread Dieter Maurer
Steven Bethard [EMAIL PROTECTED] writes on Tue, 25 Jan 2005 12:22:13 -0700: Fuzzyman wrote: ... A better (and of course *vastly* more powerful but unfortunately only a dream ;-) is a similarly limited python virutal machine. I already wrote about the RestrictedPython which is part of

Re: Zope: Adding a layer causes valid output to become an object reference?

2005-02-13 Thread Dieter Maurer
Junkmail [EMAIL PROTECTED] writes on 10 Feb 2005 18:26:52 -0800: I've been playing with Zope for about a year and took the plunge last week into making a product. You should send Zope related questions to the Zope mailing list. You will need to subcribe. You can do this at http://www.zope.org;.

Re: KeyboardInterrupt vs extension written in C

2005-10-22 Thread Dieter Maurer
Tamas Nepusz [EMAIL PROTECTED] writes on 20 Oct 2005 15:39:54 -0700: The library I'm working on is designed for performing calculations on large-scale graphs (~1 nodes and edges). I want to create a Python interface for that library, so what I want to accomplish is that I could just type

Re: Python-based Document Management System?

2005-11-15 Thread Dieter Maurer
W. Borgert [EMAIL PROTECTED] writes on Thu, 10 Nov 2005 14:43:14 +0100: I'm looking for a Python-based DMS, but I don't know any. The following points are relevant: - suitable for 10..100 users with more than 1 documents - documents are mostly proprietary formats: MS Word, MS Excel,

Re: Profiling with hotshot and wall clock time

2005-11-26 Thread Dieter Maurer
Geert Jansen [EMAIL PROTECTED] writes on Thu, 24 Nov 2005 21:33:03 +0100: ... Is possible to use hotshot with wall clock time, i.e. is it possible to have the code fragment below show one second as opposed to zero? The old profiler seems to have functionality choosing a timer function but it

Re: Python2.4: building '_socket' extension fails with `INET_ADDRSTRLEN' undeclared

2004-12-05 Thread Dieter Maurer
Martin v. Löwis [EMAIL PROTECTED] writes on Sat, 04 Dec 2004 00:37:43 +0100: ... So it appears that on your system, INET_ADDRSTRLEN is not defined, even if it is supposed to be defined on all systems, regardless of whether they support IPv6. I have met this problem in older Solaris versions:

Re: How to set condition breakpoints?

2004-12-18 Thread Dieter Maurer
Christopher J. Bottaro [EMAIL PROTECTED] writes on Fri, 10 Dec 2004 11:45:19 -0600: ... Hmm, thanks for the suggestions. One more quick question. Is it even possible to set a breakpoint in a class method in pdb.py? I can't even say break Class.f without the condition. I don't think the

Re: Embedding a restricted python interpreter

2005-01-08 Thread Dieter Maurer
Doug Holton [EMAIL PROTECTED] writes on Thu, 06 Jan 2005 20:34:31 -0600: ... Hi, there is a page on this topic here: http://www.python.org/moin/SandboxedPython The short answer is that it is not possible to do this with the CPython, but you can run sandboxed code on other virtual machines,

Re: Simpler transition to PEP 3000 Unicode only strings?

2005-09-21 Thread Dieter Maurer
Petr Prikryl [EMAIL PROTECTED] writes on Tue, 20 Sep 2005 11:21:59 +0200: ... The idea: = What do you think about the following proposal that goes the half way If the Python source file is stored in UTF-8 (or other recognised Unicode file format), then the encoding

Removing nested tuple function parameters (was: C#3.0 and lambdas)

2005-09-21 Thread Dieter Maurer
Fredrik Lundh [EMAIL PROTECTED] writes on Mon, 19 Sep 2005 10:31:48 +0200: ... meanwhile, over in python-dev land: Is anyone truly attached to nested tuple function parameters; 'def fxn((a,b)): print a,b'? /.../ Yes, I am... Would anyone really throw a huge fit if they went

Re: strange import phenomenon

2005-09-21 Thread Dieter Maurer
Christoph Zwerschke [EMAIL PROTECTED] writes on Tue, 20 Sep 2005 11:20:37 +0200: Just hitting a strange problem with Python import behavior. It is the same on all Python 2.x versions and it is probably correct, but I currently don't understand why this happens. ... --- dir/__init__.py ---

Re: Is Python suitable for a huge, enterprise size app?

2005-05-27 Thread Dieter Maurer
Fredrik Lundh [EMAIL PROTECTED] writes on Tue, 24 May 2005 22:38:05 +0200: ... nothing guarantees that, of course. but I've never seen that happen. and I'm basing my comments on observed behaviour in real systems, not on theoretical worst-case scenarios. I observed in real systems (Zope)

Re: python24.zip

2005-05-27 Thread Dieter Maurer
Martin v. Löwis [EMAIL PROTECTED] writes on Tue, 24 May 2005 23:58:03 +0200: ... 10.000 failing opens -- a cause for significant IO during startup ? ... So I would agree that IO makes a significant part of startup, but I doubt it is directory reading (unless perhaps you have an absent NFS

Re: python24.zip

2005-05-27 Thread Dieter Maurer
Scott David Daniels [EMAIL PROTECTED] writes on Wed, 25 May 2005 07:10:00 -0700: ... I'll bet this means that the 'zope.zip', 'python24.zip' would drop you to about 12500 - 1 = 2500 failing opens. That should be an easy test: sys.path.insert(0, 'zope.zip') or whatever. If that works and

Re: some profiler questions

2005-06-09 Thread Dieter Maurer
Mac [EMAIL PROTECTED] writes on 7 Jun 2005 20:38:51 -0700: 1) I'd still like to run my whole app (i.e., using main()), but I'd like to limit the profiling to only the select few subroutines. That is, say I have a set of such fns in mind, call it key_fns, and I would like to only profile

Re: subprocess module and blocking

2005-06-13 Thread Dieter Maurer
Robin Becker [EMAIL PROTECTED] writes on Sun, 12 Jun 2005 09:22:52 +: I'm using a polling loop in a thread that looks approximately like this while 1: p = find_a_process() rc = p.poll() if rc is not None: out, err = p.communicate() #deal with output

Re: Unbound names in __del__

2005-06-18 Thread Dieter Maurer
Peter Hansen [EMAIL PROTECTED] writes on Fri, 17 Jun 2005 08:43:26 -0400: ... And I don't recall the last time I saw a __del__ in third-party code I was examining. What's your use case for del? I had to use one a few days ago: To call the unlink method of a minidom object when

Re: importing packages from a zip file

2005-07-01 Thread Dieter Maurer
Scott David Daniels [EMAIL PROTECTED] writes on Wed, 29 Jun 2005 10:36:29 -0700: Peter Tillotson wrote: ... from myZip.zip import myModule.py Does this work for you? It gives me a syntax error. Typically, put the zip file on the sys.path list, and import modules and packages inside

Re: Use cases for del

2005-07-07 Thread Dieter Maurer
Daniel Dittmar [EMAIL PROTECTED] writes on Wed, 06 Jul 2005 16:12:46 +0200: Peter Hansen wrote: Arguing the case for del: how would I, in doing automated testing, ensure that I've returned everything to a clean starting point in all cases if I can't delete variables? Sometimes a global is

Re: Conditionally implementing __iter__ in new style classes

2005-07-07 Thread Dieter Maurer
Thomas Heller [EMAIL PROTECTED] writes on Wed, 06 Jul 2005 18:07:10 +0200: Thomas Heller [EMAIL PROTECTED] writes: ... class Base: def __getattr__(self, name): if name == __iter__ and hasattr(self, Iterator): return self.Iterator raise AttributeError,

Re: Revised PEP 349: Allow str() to return unicode strings

2005-08-24 Thread Dieter Maurer
Neil Schemenauer [EMAIL PROTECTED] writes on Mon, 22 Aug 2005 15:31:42 -0600: ... Some code may require that str() returns a str instance. In the standard library, only one such case has been found so far. The function email.header_decode() requires a str instance and the

Re: unicode encoding usablilty problem

2005-02-21 Thread Dieter Maurer
Fredrik Lundh [EMAIL PROTECTED] writes on Sat, 19 Feb 2005 18:44:27 +0100: aurora [EMAIL PROTECTED] wrote: I don't want to mix them. But how could I find them? How do I know this statement can be potential problem if a==b: where a and b can be instantiated individually far

Re: ZoDB's capabilities

2005-03-02 Thread Dieter Maurer
Larry Bates [EMAIL PROTECTED] writes on Mon, 28 Feb 2005 18:48:39 -0600: There is a VERY large website that uses Zope/ZODB that takes up to 9000 hits per second when it gets busy. ZODB is very fast and holds up well under load. But, you will not get 9000 hits per second from the ZODB (unless

Re: java crashes in python thread

2005-03-02 Thread Dieter Maurer
Easeway wrote: I use os.system invoking java VM, when running in python thread, the java application crashes. Andreas Jung has reported similar behaviour. He suggested that Java 1.4 and the threads of Linux 2.6 do not work reliably together. He tried Java 1.5 and this combination crashes only

Re: Tons of stats/opens to non-existing files increases Python's startupon loaded NFS servers

2005-05-06 Thread Dieter Maurer
Fredrik Lundh [EMAIL PROTECTED] writes on Fri, 6 May 2005 00:08:36 +0200: ... lots of no such file or directory ... Whoa!! After looking at what is being stat'd or open'd, it looks like 'encodings' is new in 2.4 and, even worse, everything is looked for as a zip first. so why not build

Re: Is Python suitable for a huge, enterprise size app?

2005-05-21 Thread Dieter Maurer
Fredrik Lundh [EMAIL PROTECTED] writes on Thu, 19 May 2005 09:54:15 +0200: ... and unless your operating system is totally braindead, and thus completely unfit to run huge enterprise size applications, that doesn't really matter much. leaks are problematic, large peak memory use isn't.

Re: python24.zip

2005-05-21 Thread Dieter Maurer
Martin v. Löwis [EMAIL PROTECTED] writes on Fri, 20 May 2005 18:13:56 +0200: Robin Becker wrote: Firstly should python start up with non-existent entries on the path? Yes, this is by design. Secondly is this entry be the default for some other kind of python installation? Yes.

Re: python24.zip

2005-05-22 Thread Dieter Maurer
Martin v. Löwis [EMAIL PROTECTED] writes on Sat, 21 May 2005 23:53:31 +0200: Dieter Maurer wrote: ... The question was: should python start up with **non-existent** objects on the path. I think there is no reason why path needs to contain an object which does not exist

Re: python24.zip

2005-05-22 Thread Dieter Maurer
Steve Holden [EMAIL PROTECTED] writes on Sun, 22 May 2005 09:14:43 -0400: ... There are some aspects of Python's initialization that are IMHO a bit too filesystem-dependent. I mentioned one in http://sourceforge.net/tracker/index.php?func=detailaid=1116520group_id=5470atid=105470

Re: python24.zip

2005-05-24 Thread Dieter Maurer
Steve Holden [EMAIL PROTECTED] writes on Sun, 22 May 2005 16:19:10 -0400: ... Indeed I have written PEP 302-based code to import from a relational database, but I still don't believe there's any satisfactory way to have [such a hooked import mechanism] be a first-class component of an

Re: python24.zip

2005-05-24 Thread Dieter Maurer
Martin v. Löwis [EMAIL PROTECTED] writes on Sun, 22 May 2005 21:24:41 +0200: ... What do you mean, unable to? It just doesn't. The original question was: why does Python put non-existing entries on 'sys.path'. Your answer seems to be: it just does not do it -- but it might be changed if

Re: ZSI and attachments

2008-03-14 Thread Dieter Maurer
Laszlo Nagy [EMAIL PROTECTED] writes on Tue, 11 Mar 2008 15:59:36 +0100: I wonder if the newest ZSI has support for attachments? Last time I checked (about a year ago) this feature was missing. I desperately need it. Alternatively, is there any other SOAP lib for python that can handle

Re: Tremendous slowdown due to garbage collection

2008-04-27 Thread Dieter Maurer
Christian Heimes [EMAIL PROTECTED] writes on Sat, 12 Apr 2008 18:47:32 +0200: [EMAIL PROTECTED] schrieb: which made me suggest to use these as defaults, but then Martin v. Löwis wrote that No, the defaults are correct for typical applications. At that point I felt lost and as the

Re: Tremendous slowdown due to garbage collection

2008-04-28 Thread Dieter Maurer
Martin v. Löwis wrote at 2008-4-27 19:33 +0200: Martin said it but nevertheless it might not be true. We observed similar very bad behaviour -- in a Web application server. Apparently, the standard behaviour is far from optimal when the system contains a large number of objects and

Re: Remove multiple inheritance in Python 3000

2008-04-28 Thread Dieter Maurer
Nick Stinemates [EMAIL PROTECTED] writes on Thu, 24 Apr 2008 08:26:57 -0700: On Tue, Apr 22, 2008 at 04:07:01AM -0700, GD wrote: Please remove ability to multiple inheritance in Python 3000. I hope your request will not be followed. Multiple inheritance is bad for design, rarely used and

Re: Tremendous slowdown due to garbage collection

2008-05-01 Thread Dieter Maurer
John Nagle [EMAIL PROTECTED] writes on Mon, 28 Apr 2008 11:41:41 -0700: Dieter Maurer wrote: Christian Heimes [EMAIL PROTECTED] writes on Sat, 12 Apr 2008 18:47:32 +0200: [EMAIL PROTECTED] schrieb: which made me suggest to use these as defaults, but then We observed similar very bad

Re: The Importance of Terminology's Quality

2008-05-13 Thread Dieter Maurer
[EMAIL PROTECTED] [EMAIL PROTECTED] writes on Wed, 7 May 2008 16:13:36 -0700 (PDT): ... Let me give a few example. • “lambda”, widely used as a keyword in functional languages, is named just “Function” in Mathematica. The “lambda” happend to be called so in the field of symbolic logic, is

Re: Zsi interoperability

2008-09-18 Thread Dieter Maurer
Mailing List SVR [EMAIL PROTECTED] writes on Tue, 16 Sep 2008 08:31:13 +0200: ... however my server require client certificate authentication, does soaplib or zsi work in this environment? ZSI allows you to provide an alternative transport. That's the usual way to let ZSI work over https

Re: Zsi interoperability

2008-09-18 Thread Dieter Maurer
Marco Bizzarri [EMAIL PROTECTED] writes on Mon, 15 Sep 2008 20:26:27 +0200: On Mon, Sep 15, 2008 at 8:15 PM, Stefan Behnel [EMAIL PROTECTED] wrote: Mailing List SVR wrote: I have to implement a soap web services from wsdl, the server is developed using oracle, is zsi or some other python

Nested generator caveat

2008-07-03 Thread Dieter Maurer
I met the following surprising behaviour def gen0(): ... for i in range(3): ... def gen1(): ... yield i ... yield i, gen1() ... for i,g in gen0(): print i, g.next() ... 0 0 1 1 2 2 for i,g in list(gen0()): print i, g.next() ... 0 2 1 2 2 2 If this is not a bug, it is at least

Re: pythonic backtrace with gdb

2008-01-24 Thread Dieter Maurer
Hynek Hanke [EMAIL PROTECTED] writes on Wed, 23 Jan 2008 14:30:22 +0100: ... I've also tried to use the backtrace script here http://mashebali.com/?Python_GDB_macros:The_Macros:Backtrace But I get a different error: (gdb) pbt Invalid type combination in ordering comparison. I'm using GDB

Re: Large production environments using ZODB/ZOE?

2008-08-17 Thread Dieter Maurer
Phillip B Oldham [EMAIL PROTECTED] writes on Thu, 7 Aug 2008 09:26:04 -0700 (PDT): I've been reading a lot recently on ZODB/ZOE, but I've not seen any reference to its use in large-scale production envrironments. Are there any real-world examples of ZODB/ZOE in use for a large system? By

Re: Interrupt python thread

2008-08-30 Thread Dieter Maurer
En Mon, 25 Aug 2008 05:00:07 -0300, BlueBird [EMAIL PROTECTED] escribi╴: Unfortunately, this does not map very well with my program. Each of my threads are calling foreign code (still written in python though), which might be busy for 1 to 10 minutes with its own job. I wanted something to

Re: SOAPpy, WSDL and objects

2006-03-08 Thread Dieter Maurer
[EMAIL PROTECTED] writes on 7 Mar 2006 08:14:47 -0800: login request firstnameFirstName/firstname lastnameLastName/lastname /request /login I am trying to do this with the following code: from SOAPpy import WSDL server = WSDL.Proxy(m_url) request = {'firstname':

Re: Possible inaccuracy in Python 2.4 when using profiler calibration

2006-06-16 Thread Dieter Maurer
Brian Quinlan [EMAIL PROTECTED] writes on Thu, 15 Jun 2006 10:36:26 +0200: I have a misinformed theory that I'd like to share with the list. I believe that profiler calibration no longer makes sense in Python 2.4 because C functions are tracked and they have a different call overhead than

Re: Remote Boot Manager Scripting (Python)

2006-06-23 Thread Dieter Maurer
[EMAIL PROTECTED] writes on 21 Jun 2006 07:43:17 -0700: ... I have to remotely start a computer. It has dual boot (WinXP and Linux). My remote computer is Linux which will send command to remotely boot the other computer. Can we write python script or some utility which would let us select

Re: Program slowing down with greater memory use

2006-06-25 Thread Dieter Maurer
Dan Stromberg [EMAIL PROTECTED] writes on Thu, 22 Jun 2006 23:36:00 GMT: I have two different python programs that are slowing down quite a bit as their memory use goes up. I have seen this too with Zope. I do not know where it comes from -- maybe from degraded locality. Dieter --

Re: [Pyrex] pyrex functions to replace a method (Re: replace a method in class: how?)

2006-06-29 Thread Dieter Maurer
Greg Ewing [EMAIL PROTECTED] writes on Wed, 28 Jun 2006 11:56:55 +1200: ... I have suggested that builtin functions should be given the same method-binding behaviour as interpreted functions. The idea wasn't rejected out of hand, but I don't think anything has been done about it yet. You can

Re: Detecting socket connection failure

2006-07-15 Thread Dieter Maurer
[EMAIL PROTECTED] writes on 10 Jul 2006 08:42:11 -0700: I've tried to RTFM this and am having no luck.First off, I am using Mac OSX 10.4.7 with python 2.4.2 from fink. I am trying to connect to a server that should be rejecting connections and I was surprised when it did not throw an

Re: Detecting socket connection failure

2006-07-24 Thread Dieter Maurer
[EMAIL PROTECTED] writes on 19 Jul 2006 08:34:00 -0700: ... Were you also using mac osx? No, I have observed the problem under Linux. Dieter Maurer wrote: I have seen something similar recently: I can write (send to be precise) to a socket closed by the foreign partner

Re: a bug in list.remove?

2006-08-21 Thread Dieter Maurer
Astan Chee [EMAIL PROTECTED] writes on Sat, 19 Aug 2006 03:34:26 +1000: for p in ps: if p in qs: ps.remove(p) You are modifying an object (ps) while you iterate over it. This is a receipe for surprises... The standard idiom is to iterate over a copy rather than the object

Re: Input from the same file as the script

2006-08-22 Thread Dieter Maurer
Georg Brandl [EMAIL PROTECTED] writes on Sun, 20 Aug 2006 20:08:38 +0200: [EMAIL PROTECTED] wrote: Can the input to the python script be given from the same file as the script itself. e.g., when we execute a python script with the command 'python scriptName', can the input be given in

Re: Don't use __slots__ (was Re: performance of dictionary lookup vs. object attributes)

2006-08-28 Thread Dieter Maurer
Patrick Maupin [EMAIL PROTECTED] writes on 26 Aug 2006 12:51:44 -0700: ... The only problem I personally know of is that the __slots__ aren't inherited, __slots__ *ARE* inherited, although the rules may be a bit complex. class B(object): ... __slots__ = ('f1', 'f2',) ... class C(B): pass

Re: [Zope] how do I test for the current item in an iteration

2007-09-28 Thread Dieter Maurer
kamal hamzat wrote at 2007-9-28 16:36 +0100: I have this error after i added the if statement Error Type: TypeError Error Value: mybrains.__cmp__(x,y) requires y to be a 'mybrains', not a 'int' for i in context.zCatNewsCurrent(): if i = 5: print %s: %s: %s % (i.id, i.author,

Re: Survival of the fittest

2006-09-28 Thread Dieter Maurer
Thomas Bartkus [EMAIL PROTECTED] writes on Tue, 26 Sep 2006 22:06:56 -0500: ... We would be curious to know about those things you can do in C++ but can't do in Python. I implemented an incremental search engine in Python. It worked fine for large quite specific and queries (it was faster

Re: Survival of the fittest

2006-10-03 Thread Dieter Maurer
Dennis Lee Bieber [EMAIL PROTECTED] writes on Thu, 28 Sep 2006 23:57:51 GMT: On 28 Sep 2006 22:48:21 +0200, Dieter Maurer [EMAIL PROTECTED] declaimed the following in comp.lang.python: We learn: a C/C++ implementation can in some cases be drastically more efficient than a Python one

Re: Profiling Python

2008-12-06 Thread Dieter Maurer
[EMAIL PROTECTED] writes on Wed, 3 Dec 2008 07:13:14 -0800 (PST): To clarify again, Is there some function like profile.PrintStats() which dynamically shows the stats before stopping the Profiler? Try to (deep) copy the profiler instance and than call PrintStats() on the copy. Of course, you

Re: advice needed for lazy evaluation mechanism

2009-11-11 Thread Dieter Maurer
Steven D'Aprano st...@remove-this-cybersource.com.au writes on 10 Nov 2009 19:11:07 GMT: ... So I am trying to restructure it using lazy evaluation. Oh great, avoiding confusion with something even more confusing. Lazy evaluation may be confusing if it is misused. But, it may be very clear

Re: setattr() oddness

2010-01-17 Thread Dieter Maurer
Lie Ryan lie.1...@gmail.com writes on Sat, 16 Jan 2010 19:37:29 +1100: On 01/16/10 10:10, Sean DiZazzo wrote: Interesting. I can understand the would take time argument, but I don't see any legitimate use case for an attribute only accessible via getattr(). Well, at least not a pythonic

Re: setattr() oddness

2010-01-19 Thread Dieter Maurer
Steven D'Aprano ste...@remove.this.cybersource.com.au writes on 18 Jan 2010 06:47:59 GMT: On Mon, 18 Jan 2010 07:25:58 +0100, Dieter Maurer wrote: Lie Ryan lie.1...@gmail.com writes on Sat, 16 Jan 2010 19:37:29 +1100: On 01/16/10 10:10, Sean DiZazzo wrote: Interesting. I can understand

Re: Memory usage problem of twisted server

2010-01-21 Thread Dieter Maurer
Victor Lin borns...@gmail.com writes on Wed, 20 Jan 2010 02:52:25 -0800 (PST): Hi, I encountered an increasing memory usage problem of my twisted server. I have posted a question on stackoverflow:

Re: Use eval() safely?

2010-02-24 Thread Dieter Maurer
Steven D'Aprano ste...@remove.this.cybersource.com.au writes on 22 Feb 2010 06:07:05 GMT: ... It's *especially* not safe if you put nothing in the globals dict, because Python kindly rectifies that by putting the builtins into it: eval(__builtins__.keys(), {}, {}) ['IndexError', 'all',

Re: break unichr instead of fix ord?

2009-08-29 Thread Dieter Maurer
Martin v. Löwis mar...@v.loewis.de writes on Fri, 28 Aug 2009 10:12:34 +0200: The PEP says: * unichr(i) for 0 = i 2**16 (0x1) always returns a length-one string. * unichr(i) for 2**16 = i = TOPCHAR will return a length-one string on wide Python builds. On

Re: Things to know about super (was: super() and multiple inheritance failure)

2009-09-28 Thread Dieter Maurer
Michele Simionato michele.simion...@gmail.com writes on Fri, 25 Sep 2009 22:58:32 -0700 (PDT): ... You know that in an ideal world I would just throw away multiple inheritance, it is just not worth the complication. I am a fan of multiple inheritance: it lets the compliler/language runtime do

Re: python performance on Solaris

2009-10-16 Thread Dieter Maurer
Antoine Pitrou solip...@pitrou.net writes on Thu, 15 Oct 2009 16:25:43 + (UTC): Le Wed, 14 Oct 2009 22:39:14 -0700, John Nagle a écrit : Note that multithreaded compute-bound Python programs really suck on multiprocessors. Adding a second CPU makes the program go slower, due to

Re: restriction on sum: intentional bug?

2009-10-17 Thread Dieter Maurer
Christian Heimes li...@cheimes.de writes on Fri, 16 Oct 2009 17:58:29 +0200: Alan G Isaac schrieb: I expected this to be fixed in Python 3: sum(['ab','cd'],'') Traceback (most recent call last): File stdin, line 1, in module TypeError: sum() can't sum strings [use ''.join(seq)

[OT] Supporting homework (was: Re: Checking a Number for Palindromic Behavior)

2009-10-22 Thread Dieter Maurer
Steven D'Aprano ste...@remove.this.cybersource.com.au writes on 20 Oct 2009 05:35:18 GMT: As far as I'm concerned, asking for help on homework without being honest up-front about it and making an effort first, is cheating by breaking the social contract. Anyone who rewards cheaters by giving

Re: Python 2.6 Deprecation Warnings with __new__ Can someone explain why?

2009-10-24 Thread Dieter Maurer
Terry Reedy tjre...@udel.edu writes on Fri, 23 Oct 2009 03:04:41 -0400: Consider this: def blackhole(*args, **kwds): pass The fact that it accept args that it ignores could be considered misleading or even a bug. Maybe, it could. But, it is by no means necessary. In mathematics, there is

Re: httplib incredibly slow :-(

2009-08-14 Thread Dieter Maurer
Chris Withers ch...@simplistix.co.uk writes on Thu, 13 Aug 2009 08:20:37 +0100: ... I've already established that the file downloads in seconds with [something else], so I'd like to understand why python isn't doing the same and fix the problem... A profile might help to understand what the

Re: Can I get logging.FileHandler to close the file on each emit?

2012-08-30 Thread Dieter Maurer
rikardhul...@gmail.com writes: I use logging.FileHandler (on windows) and I would like to be able to delete the file while the process is running and have it create the file again on next log event. On windows (not tried linux) this is not possible because the file is locked by the

Re: Are the property Function really useful?

2012-08-30 Thread Dieter Maurer
levinie...@gmail.com writes: Are the property Function really useful? Someone invested time to implement/document/test it. Thus, there are people who have use cases for it... Where can i use the property function? You can use it when you have parameterless methods which you want to access as

Re: sockets,threads and interupts

2012-09-04 Thread Dieter Maurer
loial jldunn2...@gmail.com writes: I have threaded python script that uses sockets to monitor network ports. I want to ensure that the socket is closed cleanly in all circumstances. This includes if the script is killed or interupted in some other way. The operating system should close all

Re: Why derivated exception can not be pickled ?

2012-09-05 Thread Dieter Maurer
Mathieu Courtois mathieu.court...@gmail.com writes: Here is my example : import cPickle ParentClass = object # works ParentClass = Exception # does not class MyError(ParentClass): def __init__(self, arg): self.arg = arg def __getstate__(self): print

Re: [web] Long-running process: FCGI? SCGI? WSGI?

2012-09-06 Thread Dieter Maurer
Gilles nos...@nospam.com writes: To write a long-running web application, I'd like to some feedback about which option to choose. Apparently, the choice boilds down to this: - FastCGI - SCGI - WSGI It seems like FCGI and SCGI are language-neutral, while WSGI is Python-specific.

Re: How to implement a combo Web and Desktop app in python.

2012-09-14 Thread Dieter Maurer
Shawn McElroy luckysm...@gmail.com writes: ... So I need to find a way I can implement this in the best way... It is in general very difficult to say reliable things about the best way. Because, that depends very much on details. My former employer has created a combo destop/online

Re: Decorators not worth the effort

2012-09-14 Thread Dieter Maurer
On Sep 14, 3:54 am, Jean-Michel Pichavant jeanmic...@sequans.com wrote: I don't like decorators, I think they're not worth the mental effort. Fine. I like them because they can vastly improve reusability and drastically reduce redundancies (which I hate). Improved reusability and reduced

Re: How to implement a combo Web and Desktop app in python.

2012-09-15 Thread Dieter Maurer
Shawn McElroy luckysm...@gmail.com writes: ... Although you are correct in the aspect of having 'real' OS level integration. Being able to communicate with other apps as well as contextual menus. Although, could I not still implement those features from python, into the host system from

Re: Decorators not worth the effort

2012-09-15 Thread Dieter Maurer
Dwight Hutto wrote at 2012-9-14 23:42 -0400: ... Reduce redundancy, is argumentative. To me, a decorator, is no more than a logging function. Correct me if I'm wrong. Well, it depends on how you are using decorators and how complex your decorators are. If what you are using as decorating

Re: Decorators not worth the effort

2012-09-18 Thread Dieter Maurer
Jean-Michel Pichavant jeanmic...@sequans.com writes: - Original Message - Jean-Michel Pichavant wrote: [snip] One minor note, the style of decorator you are using loses the docstring (at least) of the original function. I would add the @functools.wraps(func) decorator inside your

Re: python application file format

2012-09-27 Thread Dieter Maurer
Benjamin Jessup b...@abzinc.com writes: ... What do people recommend for a file format for a python desktop application? Data is complex with 100s/1000s of class instances, which reference each other. ... Use cPickle with a module/class whitelist? (Can't easily port, not entirely safe,

Re: Private methods

2012-10-11 Thread Dieter Maurer
alex23 wuwe...@gmail.com writes: On 10 Oct, 17:03, real-not-anti-spam-addr...@apple-juice.co.uk (D.M. Procida) wrote: It certainly makes it quick to build a class with the attributes I need, but it does make tracing logic sometimes a pain in the neck. I don't know what the alternative is

Re: serialization and versioning

2012-10-13 Thread Dieter Maurer
Neal Becker ndbeck...@gmail.com writes: I wonder if there is a recommended approach to handle this issue. Suppose objects of a class C are serialized using python standard pickling. Later, suppose class C is changed, perhaps by adding a data member and a new constructor argument. It

Re: deque and thread-safety

2012-10-13 Thread Dieter Maurer
Christophe Vandeplas christo...@vandeplas.com writes: ... From the documentation I understand that deques are thread-safe: Deques are a generalization of stacks and queues (the name is pronounced “deck” and is short for “double-ended queue”). Deques support thread-safe, memory efficient

Re: problems with xml parsing (python 3.3)

2012-10-28 Thread Dieter Maurer
janni...@gmail.com writes: I am new to Python and have a problem with the behaviour of the xml parser. Assume we have this xml document: ?xml version=1.0 encoding=UTF-8? bibliography entry Title of the first book. /entry entry coauthored/

Re: Applying a paid third party ssl certificate

2012-11-04 Thread Dieter Maurer
ehsmenggro...@gmail.com writes: I haven't quite figured out how to apply a paid ssl cert, say RapidSSL free SSL test from Python's recent sponsor sslmatrix.com and what to do with that to make Python happy. This good fellow suggests using the PEM format. I tried and failed.

Re: Python garbage collector/memory manager behaving strangely

2012-11-14 Thread Dieter Maurer
a...@pythoncraft.com (Aahz) writes: ... def readlines(f): lines = [] while f is not empty: line = f.readline() if not line: break if len(line) 2 and line[-2:] == '|\n': lines.append(line) yield

Re: Getting empty attachment with smtplib

2012-11-14 Thread Dieter Maurer
Tobiah t...@tobiah.org writes: I just found out that the attachment works fine when I read the mail from the gmail website. Thunderbird complains that the attachment is empty. The MIME standard (a set of RFCs) specifies how valid messages with attachments should look like. Fetch the mail

Re: error importing smtplib

2012-11-16 Thread Dieter Maurer
Eric Frederich eric.freder...@gmail.com writes: I created some bindings to a 3rd party library. I have found that when I run Python and import smtplib it works fine. If I first log into the 3rd party application using my bindings however I get a bunch of errors. What do you think this 3rd

Re: error importing smtplib

2012-11-17 Thread Dieter Maurer
Eric Frederich eric.freder...@gmail.com writes: ... So I'm guessing the problem is that after I log in, the process has a conflicting libssl.so file loaded. Then when I try to import smtplib it tries getting things from there and that is where the errors are coming from. The question

Re: Stack_overflow error

2012-11-20 Thread Dieter Maurer
Aung Thet Naing aung.thetna...@gmail.com writes: I'm having Stack_overflow exception in _ctypes_callproc (callproc.c). The error actually come from the: cleanup: for (i = 0; i argcount; ++i) Py_XDECREF(args[i].keep); when args[i].keep-ob_refCnt == 1 Really a stack overflow

Re: Suitable software stacks for simple python web service

2012-11-21 Thread Dieter Maurer
Kev Dwyer kevin.p.dw...@gmail.com writes: I have to build a simple web service which will: - receive queries from our other servers - forward the requests to a third party SOAP service - process the response from the third party - send the result back to the original requester From

Re: deepcopy questions

2012-11-28 Thread Dieter Maurer
lars van gemerden l...@rational-it.com writes: ... deepcopy dropping some items ... Any ideas are still more then welcome, deepcopy is implemented in Python (rather than C). Thus, if necessary, you can debug what it is doing and thereby determine where the items have been dropped. --

Re: os.system and subprocess odd behavior

2012-12-14 Thread Dieter Maurer
py_genetic conor.robin...@gmail.com writes: Example of the issue for arguments sake: Platform Ubuntu server 12.04LTS, python 2.7 Say file1.txt has hello world in it. ^ Here, you speak of file1.txt (note the extension .txt) subprocess.Popen(cat file1 file2, shell = True)

Re: need some help with unexpected signal exception when using input from a thread (Pypy 1.9.0 on osx/linux)

2012-12-15 Thread Dieter Maurer
Irmen de Jong irmen.nos...@xs4all.nl writes: Using Pypy 1.9.0. Importing readline. Using a background thread to get input() from stdin. It then crashes with: File /usr/local/Cellar/pypy/1.9/lib_pypy/pyrepl/unix_console.py, line 400, in restore signal.signal(signal.SIGWINCH,

Re: Using pdb with greenlet?

2012-06-13 Thread Dieter Maurer
Salman Malik salma...@live.com writes: I am sort of a newbie to Python ( have just started to use pdb). My problem is that I am debugging an application that uses greenlets and when I encounter something in code that spawns the coroutines or wait for an event, I lose control over the

Re: validating XML

2012-06-13 Thread Dieter Maurer
andrea crotti andrea.crott...@gmail.com writes: Hello Python friends, I have to validate some xml files against some xsd schema files, but I can't use any cool library as libxml unfortunately. Why? It seems not very rational to implement a complex task (such as XML-Schema validation) when

Re: validating XML

2012-06-14 Thread Dieter Maurer
andrea crotti andrea.crott...@gmail.com writes: ... The reason is that it has to work on many platforms and without any c module installed, the reason of that Searching for a pure Python solution, you might have a look at PyXB. It has not been designed to validate XML instances against

  1   2   3   4   >