2013/6/1 Alan Jhonn Aguiar Schwyn <alan...@hotmail.com>:
> Hi,
>
> I'm was seeing some parts of the code and I found that in every "write"
> is called the _interop.as_array function changing a list or similar to
> a byte array. But if I pass a byte array, it change in a new! Seems that is
> not efficient (but maybe array.array knows that and returns the same).
>
> Would be good add something like this:
>
> def as_array(data=None):
>     if data is None:
>         return array.array('B')
>
>     elif isinstance(data, array.array) and data.typecode == 'B':
>         return data
>
>     try:
>         return array.array('B', data)
>     except TypeError:
>         .....
>

Would you mind providind a patch or pull request, please?

-- 
Best Regards,
Wander Lairson Costa

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to