From robertwb at gmail.com Fri Jan 9 08:04:23 2015 From: robertwb at gmail.com (Robert Bradshaw) Date: Thu, 8 Jan 2015 23:04:23 -0800 Subject: [Cython] Cythonize silently ignores nonexistent files In-Reply-To: <54953B06.9040700@behnel.de> References: <54953B06.9040700@behnel.de> Message-ID: On Sat, Dec 20, 2014 at 1:01 AM, Stefan Behnel wrote: > Kevin Norris schrieb am 20.12.2014 um 01:47: >> Is this behavior intentional? >> >> >>> from Cython.Build import cythonize >> >>> cythonize('/this/file/doesnt/exist.pyx') >> [] > > Yes, it's intentional. The path you pass is actually a glob expression, so > it may match any number of files. > > >> It would be *really* nice if Cython would raise an exception (or >> something) in this case. I just spent 20 minutes trying to puzzle out >> Cython/Setuptools compatibility when the actual problem was staring me >> in the face. > > I think we should issue a warning if the expression matches nothing at all > as that's most likely not intended by the user. I agree. https://github.com/cython/cython/commit/1fdd0ca794a31c11a96ff845e003ff2e1917b1e8 From robertwb at gmail.com Sun Jan 18 00:10:45 2015 From: robertwb at gmail.com (Robert Bradshaw) Date: Sat, 17 Jan 2015 15:10:45 -0800 Subject: [Cython] Cython 0.22.alpha Message-ID: It's been too long since we've done a release, and the features have started to pile up, so I'm getting the ball rolling with 0.22.alpha0. I've uploaded a tarball to http://cython.org/release/Cython-0.22.alpha0.tar.gz; you can also get it from github. Let me know what breaks/works for you, and if there's anything you think should get in. If feedback is good I'll be cutting a beta (to the users list) next week. - Robert From mouse at yandex-team.ru Mon Jan 19 09:39:33 2015 From: mouse at yandex-team.ru (Anton D. Kachalov) Date: Mon, 19 Jan 2015 11:39:33 +0300 Subject: [Cython] Cython 0.22.alpha In-Reply-To: References: Message-ID: <322451421656773@webcorp02g.yandex-team.ru> Hello. I have?a feauture request. Support metaclass for cdef'ed classes. I have a workaround, but it has some limitations. The trick changes ctype.ob_base.ob_base.ob_type for python3 or ctype.ob_type for python2 to the metaclass type: installation hook: https://github.com/ya-mouse/qbee/blob/master/src/_core.pyx#L30 metaclass definition: https://github.com/ya-mouse/qbee/blob/master/src/_core.pyx#L139 execution a hook: https://github.com/ya-mouse/qbee/blob/master/src/_core.pyx#L201 There is a limitation for the inherited cdef'ed class: this class on instantiation wouldn't call anything from metaclass: https://github.com/ya-mouse/simavr/blob/qbee/simavr/_simavr.pyx#L210 to achieve the needed behaviour we have to define an empty regular Python class with cdef'ed base class: https://github.com/ya-mouse/simavr/blob/qbee/simavr/_simavr.pyx#L293 Workaround was originally found here: http://git.enlightenment.org/legacy/bindings/python/python-evas.git/tree/evas/evas.c_evas.pyx#n658 18.01.2015, 02:11, "Robert Bradshaw" : > ?It's been too long since we've done a release, and the features have > ?started to pile up, so I'm getting the ball rolling with 0.22.alpha0. > ?I've uploaded a tarball to > ?http://cython.org/release/Cython-0.22.alpha0.tar.gz; you can also get > ?it from github. > > ?Let me know what breaks/works for you, and if there's anything you > ?think should get in. If feedback is good I'll be cutting a beta (to > ?the users list) next week. > > ?- Robert > ?_______________________________________________ > ?cython-devel mailing list > ?cython-devel at python.org > ?https://mail.python.org/mailman/listinfo/cython-devel -- Anton D. Kachalov From fnc4 at cornell.edu Thu Jan 22 05:14:21 2015 From: fnc4 at cornell.edu (Favian Contreras) Date: Wed, 21 Jan 2015 20:14:21 -0800 Subject: [Cython] Variable Step Value Message-ID: Hey all, I am having some trouble figuring out how to pass in an extra IfStatNode in Optimize.py, to the code generation stage (see 1st commented block). I am also having trouble getting the temp variable of the iteration variable, so that I can adjust the temp to be the value that would be in index (see the 2nd comment block), before the iteration variable gets set. As of now I get the correct number of steps, as long as the step value is not 0. I've tried making these fields "StatListNode"s, but that gives a messy error. Any suggestions for how to handle these 2 problems? commit: https://github.com/BigFav/cython/commit/015440543b051168cb34441a6a8494b6fa5bdd7c Thanks, Favian Contreras -------------- next part -------------- An HTML attachment was scrubbed... URL: From robertwb at gmail.com Thu Jan 22 08:36:12 2015 From: robertwb at gmail.com (Robert Bradshaw) Date: Wed, 21 Jan 2015 23:36:12 -0800 Subject: [Cython] Cython 0.22 beta Message-ID: I've posted a beta for Cython 0.22, please try it out and report any problems (and successes) you encounter. http://cython.org/release/Cython-0.22.beta0.tar.gz From apps.embedded at gmail.com Tue Jan 27 15:12:13 2015 From: apps.embedded at gmail.com (Apps Embedded) Date: Tue, 27 Jan 2015 15:12:13 +0100 Subject: [Cython] IPython with Cython support on Android Message-ID: Hi, We have developped an android app which makes it possible to use the IPython shell through Android. https://play.google.com/store/apps/details?id=com.appsopensource.labpy https://play.google.com/store/apps/details?id=com.appsopensource.labpypremium We decided then to add the Cython extension to speed up script execution through the notebook for instance. Our app bundle is covered by the Gnu GPL v3 licence. Cython is covered by the Apache Licence version 2.0 which is compatible with the Gnu GPL v3 licence. Our question concerns the Pyrex licence on which Cython is based. It is on OSI approved licence. >From your point of view, is the Pyrex licence GPL v3 compatible ? Thanks for your help. Apps Embedded team. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rhansen at bbn.com Tue Jan 27 23:38:17 2015 From: rhansen at bbn.com (Richard Hansen) Date: Tue, 27 Jan 2015 17:38:17 -0500 Subject: [Cython] bug in typed memoryviews (memoryviewslice) Message-ID: <54C81359.6090200@bbn.com> Hi all, If I create foo.pyx with the following contents: cpdef object foo(): cdef unsigned char[:] s = "012345" return s I notice the following behavior: $ python -c ' import foo m=foo.foo() print repr(memoryview(m.base).tobytes()) print repr(memoryview(m).tobytes()) ' '012345' '123450' Notice how the bytes are printed in the wrong order unless I use the original buffer object via the typed memoryview object's base attribute. -Richard From wstein at gmail.com Wed Jan 28 08:31:40 2015 From: wstein at gmail.com (William Stein) Date: Tue, 27 Jan 2015 23:31:40 -0800 Subject: [Cython] IPython with Cython support on Android In-Reply-To: References: Message-ID: On Tue, Jan 27, 2015 at 6:12 AM, Apps Embedded wrote: > Hi, > > We have developped an android app which makes it possible to use the IPython > shell through Android. > > https://play.google.com/store/apps/details?id=com.appsopensource.labpy > https://play.google.com/store/apps/details?id=com.appsopensource.labpypremium > > We decided then to add the Cython extension to speed up script execution > through the notebook for instance. > > Our app bundle is covered by the Gnu GPL v3 licence. > Cython is covered by the Apache Licence version 2.0 which is compatible with > the Gnu GPL v3 licence. > > Our question concerns the Pyrex licence on which Cython is based. It is on > OSI approved licence. Can you provide a link or copy of precisely what you mean by "the Pyrex licence on which Cython is based"? 7 years ago, when I forked Pyrex to create SageX, which I renamed "Cython" a little later, I think I remember the official Pyrex license being I think "do anything you want with this". That would be the relevant license for this question, not the license Pyrex might have today. That said, my memory of what happened with licensing 7 years ago is admittedly hazy. William > > From your point of view, is the Pyrex licence GPL v3 compatible ? > > Thanks for your help. > > Apps Embedded team. > > _______________________________________________ > cython-devel mailing list > cython-devel at python.org > https://mail.python.org/mailman/listinfo/cython-devel > -- William Stein Professor of Mathematics University of Washington http://wstein.org From robertwb at gmail.com Wed Jan 28 09:17:15 2015 From: robertwb at gmail.com (Robert Bradshaw) Date: Wed, 28 Jan 2015 00:17:15 -0800 Subject: [Cython] IPython with Cython support on Android In-Reply-To: References: Message-ID: On Tue, Jan 27, 2015 at 11:31 PM, William Stein wrote: > On Tue, Jan 27, 2015 at 6:12 AM, Apps Embedded wrote: >> Hi, >> >> We have developped an android app which makes it possible to use the IPython >> shell through Android. >> >> https://play.google.com/store/apps/details?id=com.appsopensource.labpy >> https://play.google.com/store/apps/details?id=com.appsopensource.labpypremium >> >> We decided then to add the Cython extension to speed up script execution >> through the notebook for instance. >> >> Our app bundle is covered by the Gnu GPL v3 licence. >> Cython is covered by the Apache Licence version 2.0 which is compatible with >> the Gnu GPL v3 licence. >> >> Our question concerns the Pyrex licence on which Cython is based. It is on >> OSI approved licence. > > Can you provide a link or copy of precisely what you mean by "the > Pyrex licence on which Cython is based"? > > 7 years ago, when I forked Pyrex to create SageX, which I renamed > "Cython" a little later, I think I remember the official Pyrex license > being I think "do anything you want with this". That would be the > relevant license for this question, not the license Pyrex might have > today. That said, my memory of what happened with licensing 7 years > ago is admittedly hazy. Yep: https://github.com/cython/cython/blob/master/COPYING.txt contains Greg's exact wording regarding Pyrex licensing. From apps.embedded at gmail.com Wed Jan 28 19:22:51 2015 From: apps.embedded at gmail.com (Apps Embedded) Date: Wed, 28 Jan 2015 19:22:51 +0100 Subject: [Cython] IPython with Cython support on Android In-Reply-To: References: Message-ID: Hi, We will add the Pyrex copyright in our about menu of the LabPy Console app : "... The original Pyrex code as of 2006-04 is licensed under the following license: "Copyright stuff: Pyrex is free of restrictions. You may use, redistribute, modify and distribute modified versions." ..." Best regards. Apps Embedded team. 2015-01-28 9:17 GMT+01:00 Robert Bradshaw : > On Tue, Jan 27, 2015 at 11:31 PM, William Stein wrote: > > On Tue, Jan 27, 2015 at 6:12 AM, Apps Embedded > wrote: > >> Hi, > >> > >> We have developped an android app which makes it possible to use the > IPython > >> shell through Android. > >> > >> https://play.google.com/store/apps/details?id=com.appsopensource.labpy > >> > https://play.google.com/store/apps/details?id=com.appsopensource.labpypremium > >> > >> We decided then to add the Cython extension to speed up script execution > >> through the notebook for instance. > >> > >> Our app bundle is covered by the Gnu GPL v3 licence. > >> Cython is covered by the Apache Licence version 2.0 which is compatible > with > >> the Gnu GPL v3 licence. > >> > >> Our question concerns the Pyrex licence on which Cython is based. It is > on > >> OSI approved licence. > > > > Can you provide a link or copy of precisely what you mean by "the > > Pyrex licence on which Cython is based"? > > > > 7 years ago, when I forked Pyrex to create SageX, which I renamed > > "Cython" a little later, I think I remember the official Pyrex license > > being I think "do anything you want with this". That would be the > > relevant license for this question, not the license Pyrex might have > > today. That said, my memory of what happened with licensing 7 years > > ago is admittedly hazy. > > Yep: https://github.com/cython/cython/blob/master/COPYING.txt contains > Greg's exact wording regarding Pyrex licensing. > _______________________________________________ > cython-devel mailing list > cython-devel at python.org > https://mail.python.org/mailman/listinfo/cython-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rhansen at bbn.com Thu Jan 29 11:14:13 2015 From: rhansen at bbn.com (Richard Hansen) Date: Thu, 29 Jan 2015 05:14:13 -0500 Subject: [Cython] bug in typed memoryviews (memoryviewslice) In-Reply-To: <54C81359.6090200@bbn.com> References: <54C81359.6090200@bbn.com> Message-ID: <54CA07F5.1090003@bbn.com> On 01/27/2015 05:38 PM, Richard Hansen wrote: > Hi all, > > If I create foo.pyx with the following contents: > > cpdef object foo(): > cdef unsigned char[:] s = "012345" > return s > > I notice the following behavior: > > $ python -c ' > import foo > m=foo.foo() > print repr(memoryview(m.base).tobytes()) > print repr(memoryview(m).tobytes()) > ' > '012345' > '123450' > > Notice how the bytes are printed in the wrong order unless I use the > original buffer object via the typed memoryview object's base attribute. It turns out that this is due to a bug in Python, not Cython. Fortunately it's relatively easy to work around this bug. I submitted a pull request containing a workaround: https://github.com/cython/cython/pull/367 -Richard From rhansen at bbn.com Fri Jan 30 02:39:28 2015 From: rhansen at bbn.com (Richard Hansen) Date: Thu, 29 Jan 2015 20:39:28 -0500 Subject: [Cython] bug in typed memoryviews (memoryviewslice) In-Reply-To: <54CA07F5.1090003@bbn.com> References: <54C81359.6090200@bbn.com> <54CA07F5.1090003@bbn.com> Message-ID: <54CAE0D0.1010008@bbn.com> On 01/29/2015 05:14 AM, Richard Hansen wrote: > On 01/27/2015 05:38 PM, Richard Hansen wrote: >> Hi all, >> >> If I create foo.pyx with the following contents: >> >> cpdef object foo(): >> cdef unsigned char[:] s = "012345" >> return s >> >> I notice the following behavior: >> >> $ python -c ' >> import foo >> m=foo.foo() >> print repr(memoryview(m.base).tobytes()) >> print repr(memoryview(m).tobytes()) >> ' >> '012345' >> '123450' >> >> Notice how the bytes are printed in the wrong order unless I use the >> original buffer object via the typed memoryview object's base attribute. > > It turns out that this is due to a bug in Python, not Cython. I submitted a couple of Python bug reports about this, with patches: http://bugs.python.org/issue23349 http://bugs.python.org/issue23352 -Richard > Fortunately it's relatively easy to work around this bug. I submitted a > pull request containing a workaround: > > https://github.com/cython/cython/pull/367 > > -Richard From supermihi at posteo.de Fri Jan 30 10:49:50 2015 From: supermihi at posteo.de (Michael) Date: Fri, 30 Jan 2015 10:49:50 +0100 Subject: [Cython] Compilation failes if a class member is named "INFINITY" Message-ID: <54CB53BE.3060404@posteo.de> Hello, if I try to compile the following minimal example: cdef class Test: cdef readonly int INFINITY cython does not complain but gcc refuses with an error message: In file included from /usr/include/math.h:38:0, from /usr/include/python2.7/pyport.h:325, from /usr/include/python2.7/Python.h:58, from testinf.c:16: testinf.c:433:7: error: field '__builtin_inff' declared as a function int INFINITY; ^ testinf.c: In function '__pyx_pf_7testinf_4Test_8INFINITY___get__': testinf.c:569:50: error: expected identifier before '(' token __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->INFINITY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ^ Apparently the name "INFINITY" is handled wrongly; any other variable name seems to be fine. Regards, Michael From matthew.brett at gmail.com Sat Jan 31 19:48:39 2015 From: matthew.brett at gmail.com (Matthew Brett) Date: Sat, 31 Jan 2015 10:48:39 -0800 Subject: [Cython] Compilation failes if a class member is named "INFINITY" In-Reply-To: <54CB53BE.3060404@posteo.de> References: <54CB53BE.3060404@posteo.de> Message-ID: Hi, On Fri, Jan 30, 2015 at 1:49 AM, Michael wrote: > Hello, > > if I try to compile the following minimal example: > > cdef class Test: > > cdef readonly int INFINITY > > cython does not complain but gcc refuses with an error message: > In file included from /usr/include/math.h:38:0, > from /usr/include/python2.7/pyport.h:325, > from /usr/include/python2.7/Python.h:58, > from testinf.c:16: > testinf.c:433:7: error: field '__builtin_inff' declared as a function > int INFINITY; > ^ > testinf.c: In function '__pyx_pf_7testinf_4Test_8INFINITY___get__': > testinf.c:569:50: error: expected identifier before '(' token > __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->INFINITY); if > (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; > __pyx_clineno = __LINE__; goto __pyx_L1_error;} > ^ > Apparently the name "INFINITY" is handled wrongly; any other variable > name seems to be fine. Maybe you hit the INFINITY gcc macro? http://www.gnu.org/software/libc/manual/html_node/Infinity-and-NaN.html Cheers, Matthew