Replacing module with a stub for unit testing

2009-05-23 Thread pigmartian
Hi, I'm working on a unit test framework for a module. The module I'm testing indirectly calls another module which is expensive to access --- CDLLs whose functions access a database. test_MyModule --->MyModule--->IntermediateModule--- >ExpensiveModule I want to create a stub of ExpensiveMo

Re: pyprocessing/multiprocessing for x64?

2008-08-06 Thread pigmartian
Interesting, I see Christian's responses to Benjamin, but not Benjamin's posts themselves. Anyways, the question remains: will multiprocessing be supported for the x64 platform when it's released in 2.6? pigmartian wrote: I recently learned (from I response on this newsgrou

pyprocessing/multiprocessing for x64?

2008-08-05 Thread pigmartian
I recently learned (from I response on this newsgroup to an earlier query) of the processing module for working with subprocesses in a similar manner to threading. For what I needed to do, it worked great --- until I tried to run my code on an x64 box, for which that module isn't available*.

Re: static variables in Python?

2008-07-29 Thread pigmartian
[EMAIL PROTECTED] wrote: kj: OK, I guess that in Python the only way to do what I want to do is with objects... There are other ways, like assigning the value out of the function, because Python functions too are objects: ... But I suggest you to use a class in this situation, it's often th

Re: ctypes - unloading implicitly loaded dlls

2008-07-28 Thread pigmartian
Nick Craig-Wood wrote: You could try loading C explicitly with ctypes.LoadLibrary() before loading A, then you'll have a handle to unload it before you load B. I did think of that, but no luck. Guess the cdll doesn't look for a dll loaded already by python. I guess that does make sense.

ctypes - unloading implicitly loaded dlls

2008-07-27 Thread pigmartian
(my apologies if this is a repost, but it sure seems like the first attempt disappeared into the ether...) I'm writing a program that uses functionality from two different sets of cdlls which reside in two different directories, call them 'libA.dll' and 'libB.dll'. Although I don't directly u

Re: Where is the correct round() method?

2008-07-27 Thread pigmartian
it could be that 3.0 is using "banker's rounding" --- rounding to the even digit. the idea behind it behind it being to reduce error accumulation when working with large sets of values. Works for me on Python 2.5 on Linux running on "Intel(R) Core(TM)2 Duo CPU". What system are you on? I