In case anyone else is interested, below is the code I ended up using to filter buffers from the input and output of the com. It makes use of the Python2.4 decorators that are added to all the functions in th py file generated by makepy. 
<br><br>I never thought I would find a reason for the decorator, but now I&#39;m really glad that feature is there!!&nbsp; :) The code was figured out by looking at the argument/return type check that is shown in the decorator PEP and making tweaks.
<br><br>Hope this helps!<br><br><a href="http://www.python.org/dev/peps/pep-0318/">http://www.python.org/dev/peps/pep-0318/</a><br><br>def list2buffer(list):<br>&nbsp;&nbsp;&nbsp; if type(list) == types.ListType:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; val =&nbsp; buffer(
array.array(&#39;B&#39;, list))<br>&nbsp;&nbsp;&nbsp; else:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; val = list<br>&nbsp;&nbsp;&nbsp; return val<br><br>def buffer2list(abuffer,width=1):<br>&nbsp;&nbsp;&nbsp; &quot;&quot;&quot;handles buffers or lists of buffers<br>&nbsp;&nbsp;&nbsp; if you actually want the buffer broken down differently than
<br>&nbsp;&nbsp;&nbsp; a single byte, then specify the width<br>&nbsp;&nbsp;&nbsp; &quot;&quot;&quot;<br>&nbsp;&nbsp;&nbsp; newlist = []<br>&nbsp;&nbsp;&nbsp; if type(abuffer) == types.ListType:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for l in abuffer:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newlist.append( buffer2list(l) )<br>&nbsp;&nbsp;&nbsp; elif type(abuffer) == 
types.BufferType:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if width is 4:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; typecode = &#39;L&#39;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; elif width is 2:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; typecode = &#39;H&#39;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; elif width is 1:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; typecode = &#39;B&#39;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; raise ValueError(&quot;Unsupported width: %d&quot;%width) <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return array.array(typecode, str(abuffer)).tolist()<br>&nbsp;&nbsp;&nbsp; else:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return abuffer<br><br>def filterin(f):<br>&nbsp;&nbsp;&nbsp; def new_f(*args, **kwds):
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newargs = []<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for i in range(len(args)):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newargs.append( list2buffer(args[i]) )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for k in kwds.keys():<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kwds[k] = list2buffer(args[i])<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return f(*newargs, **kwds)
<br>&nbsp;&nbsp;&nbsp; new_f.func_name = f.func_name<br>&nbsp;&nbsp;&nbsp; return new_f<br><br>def filterout(f):<br>&nbsp;&nbsp;&nbsp; def new_f(*args, **kwds):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; result = f(*args, **kwds)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return buffer2list( result )<br>&nbsp;&nbsp;&nbsp; new_f.func_name = f.func_name
<br>&nbsp;&nbsp;&nbsp; return new_f<br><br>@filterin<br>@filterout<br>def myfunction(somearg1,somarg2):<br>&nbsp;&nbsp; pass<br><br><br><div><span class="gmail_quote">On 5/9/07, <b class="gmail_sendername">Kevin Patterson</b> &lt;<a href="mailto:patter001@gmail.com">
patter001@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Alrighty, I&#39;ll keep looking in to it. I think it is easy to make the buffers get returned as a python list. Almost all the code exists to help with that. The tough part is telling the COM that the array being passed IN needs to become a Safe Array where the size of each element is only VT_UI1. The buffer is a great thing for that and at first glance the only thing I can think of would be to modify PyCom_VariantFromPyObject to check the size of the number to see if it will fit in VT_UI1 (it is already doing this for ints and longs)...but i think that would be way to dangerous...
<br><br>I might still look into a proposal for changing the output, but for the input, I can&#39;t think of how to do it any other way than what you already have. Perhaps I will just have to write a script that searches my generated file from makepy and creates a layer in the python code...instead of on the C side...oh well...
<br><span class="sg"><br>-Kevin</span><div><span class="e" id="q_11270fc36406a2e8_2"><br><br><div><span class="gmail_quote">On 4/29/07, <b class="gmail_sendername">Mark Hammond</b> &lt;<a href="mailto:mhammond@skippinet.com.au" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
mhammond@skippinet.com.au</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; I was curious is there a way to prevent an array of VT_UI1&#39;s from being<br>&gt; converted to a buffer? Or perhaps a way to modify the file generated<br>&gt; from &quot;makepy&quot; to prevent the conversion?<br>
<br>
Nope, no such facility exists.&nbsp;&nbsp;Feel free to propose a patch though.<br><br>Cheers,<br><br>Mark<br><br></blockquote></div><br>
</span></div></blockquote></div><br>