Is it possible to determine what a function needs for parameters -

Cameron Laird claird at lairds.us
Wed May 2 13:50:50 EDT 2007


In article <mailman.7206.1178124747.32031.python-list at python.org>,
Chris Mellon <arkanes at gmail.com> wrote:
>On 2 May 2007 09:41:56 -0700, rh0dium <steven.klass at gmail.com> wrote:
>> On May 2, 8:25 am, Gary Herron <gher... at islandtraining.com> wrote:
>> > rh0dium wrote:
			.
			.
			.
>Thats because you put the wrong value into the arguments queue.
>For this use case, we define the arguments queue as being a source of 2-tuples,
>with an argument list and a kwargs dict. So you have to do:
>
>for x in range(lod):
>    myQ.put((random.random(), {}))
>
>(don't be afraid of indentation and newlines - I started to modify
>your source to provide a working example and got frustrated
>reformatting it so I could read it)
>
>Since you've now defined the external interface for your system (pass
>it a queue of argument, kwargs tuples and a callable) it's the
>responsibility of the caller to correctly satisfy that interface.

While I agree with the programming analyses of Messrs. Herron
and Mellon (and heartily recommend Queue for folks working in
this nighborhood), it occurs to me that readers of this thread 
might also have an interest in tuplespaces <URL:
http://www.unixreview.com/documents/s=10125/ur0704l/ >.



More information about the Python-list mailing list