MS Compiler to build Python 2.3 extension

2005-06-29 Thread garyrob
Hello,

I have no Microsoft compilers on my hard disk. I recenly built a C API
Python extension for Python 2.3 on OS X, and now I need to build it for
Windows.

When I start Python 2.3 on Windows, it says it was built with "MS C
v.1200". I'm not sure how that maps to current Microsoft compiler
products.

Someone who works with me (at another location) has MS Visual Studio
Pro 6.0 which he isn't using and can send to me. Will that do the
trick? Or do I need to buy another package?

Thanks,
Gary

--

Gary Robinson
CTO [of a very tiny company]
Emergent Music, LLC
[EMAIL PROTECTED]
207-942-3463
Company: http://emergentmusic.com
Blog:http://www.garyrobinson.net

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: what's wrong with "lambda x : print x/60,x%60"

2005-12-21 Thread garyrob
> I don't understand why the critics of lambda don't understand that
> having to use so many temp variables, for either numbers or functions,
> can work against both concision and clarity.

I agree with this completely. My company has a rather large application
written in Python (http://www.goombah.com) and I find that lambdas make
code more concise and clear in a manner not unlike, for instance, list
comprehensions. I just don't see what gain would ensue from losing
them.

Gary

---

Gary Robinson
CTO
Emergent Music, LLC
[EMAIL PROTECTED]

-- 
http://mail.python.org/mailman/listinfo/python-list


pyprocessing and exceptions

2009-04-15 Thread garyrob
Hi,

We're still using Python 2.5 so this question is about the
pyprocessing module rather than the multiprocessing module, but I'm
guessing the answer is the same.

I tend to use the Pool() object to create slave processes. If
something goes wrong in the slave, an exception is raised there, which
is then raised in the master or parent process, which is great.

The problem is that if the master aborts due to the exception, it
doesn't show the usual stack trace info for the slave, which would
show (among other things) the line number the error occurred on.
Instead, it shows the line in the master where work was sent to the
slave (such as a call to pool.map()).

I'm wondering what the recommended way is to write code that will
reveal what went wrong in the slave. One obvious possibility is to
have functions that are invoked in the slave incorporate their own
exception handling that prints a stack trace. But I'd rather handle
this issue in the master, rather than have to handle it in every
function in the slave module that the master may invoke.

Is there a way to do that? If not, what's the recommended approach?

Thanks,
Gary


--
http://mail.python.org/mailman/listinfo/python-list


Re: a huge shared read-only data in parallel accesses -- How? multithreading? multiprocessing?

2010-01-03 Thread garyrob
One thing I'm not clear on regarding Klauss' patch. He says it's
applicable where the data is primarily non-numeric. In trying to
understand why that would be the case, I'm thinking that the increased
per-object memory overhead for reference-counting would outweigh the
space gains from the shared memory.

Klauss's test code stores a large number of dictionaries which each
contain just 3 items. The stored items are strings, but short ones...
it looks like they take up less space than double floats(?).

So my understanding is that the point is that the overhead for the
dictionaries is big enough that the patch is very helpful even though
the stored items are small. And that the patch would be less and less
effective as the number of items stored in each dictionary became
greater and greater, until eventually the patch might do more use more
space for reference counting than it saved by shared memory.

Is this understanding correct? (I'm hoping not, because for some
applications, I'd like to be able to use it for large dictionaries
containing lots of numbers.)

Thanks,
Gary
-- 
http://mail.python.org/mailman/listinfo/python-list