Sorry, I missed earlier bits of this thread…
On Wed, 2012-09-05 at 19:37 -0700, Ellery Newcomer wrote:
> On 09/05/2012 07:10 PM, bearophile wrote:
> >
> > Some D lazy ranges <==> Python lazy iterators/generators
> >
>
> I'll look into this one.
>
> > array.array <==> D arrays
>
> just checked, looks like we have it:
>
> PyStmts(q"{from array import array; a = array('i', [44,33,22,11]);}",
> "testing");
> assert(PyEval!(int[])("a", "testing") == [44,33,22,11]);
>
> I think if the python object is iterable, it can be converted to array.I am guessing this is interfacing to CPython, remember there is also PyPy and ActiveState, they have different ways of doing things. Well the ActiveState C API will be very close to the CPython C API, but PyPy (which is the best Python 2.7 just now) doesn't have a C API since it is written in RPython. > Matrices might pose a problem. But user can define custom conversions if > need be. > > > > > NumPy arrays <==> D arrays > > > > I have never used NumPy. Are its arrays special? Oh yes. NumPy is basically a subsystem that Python applications make calls into. Although the data structure can be accessed and amended, algorithms on the data structures should never be written in Python, they should always be function calls into the NumPy framework. > > > >> Also, which of the following looks more appealing to you? > > > > I don't know. > > > > ok, I'll be lazy then. > -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:[email protected] 41 Buckmaster Road m: +44 7770 465 077 xmpp: [email protected] London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
signature.asc
Description: This is a digitally signed message part
