From vitja.makarov at gmail.com Wed Mar 2 22:07:25 2011 From: vitja.makarov at gmail.com (Vitja Makarov) Date: Thu, 3 Mar 2011 00:07:25 +0300 Subject: [Cython] strange bug in starred target Message-ID: This doesn't work: def assign(): a, *b = 1,2,3,4,5 return a, b >>> import x >>> x.assign() Traceback (most recent call last): File "", line 1, in File "x.pyx", line 6, in x.assign (x.c:445) a, *b = 1,2,3,4,5 TypeError: Expected list, got int And this is ok: def assign(): a, *b = 1,2,3,4,5 return a, b *a, b = 1,2,3,4,5 return a, b >>> import x >>> x.assign() (1, [2, 3, 4, 5]) -- vitja. From vitja.makarov at gmail.com Wed Mar 2 22:27:20 2011 From: vitja.makarov at gmail.com (Vitja Makarov) Date: Thu, 3 Mar 2011 00:27:20 +0300 Subject: [Cython] strange bug in starred target In-Reply-To: References: Message-ID: 2011/3/3 Vitja Makarov : > This doesn't work: > def assign(): > ? ?a, *b = 1,2,3,4,5 > ? ?return a, b > >>>> import x >>>> x.assign() > Traceback (most recent call last): > ?File "", line 1, in > ?File "x.pyx", line 6, in x.assign (x.c:445) > ? ?a, *b = 1,2,3,4,5 > TypeError: Expected list, got int > > And this is ok: > > def assign(): > ? ?a, *b = 1,2,3,4,5 > ? ?return a, b > ? ?*a, b = 1,2,3,4,5 > ? ?return a, b > >>>> import x >>>> x.assign() > (1, [2, 3, 4, 5]) > > I hope problem is somewhere in map_starred_assignment() -- vitja. From vitja.makarov at gmail.com Thu Mar 3 20:44:34 2011 From: vitja.makarov at gmail.com (Vitja Makarov) Date: Thu, 3 Mar 2011 22:44:34 +0300 Subject: [Cython] strange bug in starred target In-Reply-To: References: Message-ID: 2011/3/3 Vitja Makarov : > 2011/3/3 Vitja Makarov : >> This doesn't work: >> def assign(): >> ? ?a, *b = 1,2,3,4,5 >> ? ?return a, b >> >>>>> import x >>>>> x.assign() >> Traceback (most recent call last): >> ?File "", line 1, in >> ?File "x.pyx", line 6, in x.assign (x.c:445) >> ? ?a, *b = 1,2,3,4,5 >> TypeError: Expected list, got int >> >> And this is ok: >> >> def assign(): >> ? ?a, *b = 1,2,3,4,5 >> ? ?return a, b >> ? ?*a, b = 1,2,3,4,5 >> ? ?return a, b >> >>>>> import x >>>>> x.assign() >> (1, [2, 3, 4, 5]) >> >> > > I hope problem is somewhere in map_starred_assignment() > That wasn't as simple as patch is... Ticket on trac http://trac.cython.org/cython_trac/ticket/664 Pull request https://github.com/cython/cython/pull/7 -- vitja. From anders at embl.de Tue Mar 22 15:21:30 2011 From: anders at embl.de (Simon Anders) Date: Tue, 22 Mar 2011 15:21:30 +0100 Subject: [Cython] cython crash: default parameters in methods of template cppclass Message-ID: <4D88B06A.5010802@embl.de> Hi, I found a little bug in Cython 0.14.1. The following causes the Cython compiler to throw an exception: ---8<--- cdef extern from "foo.h": cdef cppclass foo[ T ]: bar( int b = 0 ) cdef foo[ int ] a a.bar( 1 ) ---8<--- The exception is "AttributeError: 'CFuncType' object has no attribute 'op_arg_struct'", thrown in line 3044, in generate_result_code. Full stack trace attached. The file compiles without crash if one either - removes the last line, i.e. the call to the class's method, or - removes the template argument, i.e., the "[ T ]" in line 2 and the "[ int ]" in line 5. Hence, the issue only appears when calling methods of _templated_ classes, which have a _default_ value for their argument. Simon +--- | Dr. Simon Anders, Dipl.-Phys. | European Molecular Biology Laboratory (EMBL), Heidelberg | office phone +49-6221-387-8632 | preferred (permanent) e-mail: sanders at fs.tum.de -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: trace Url: http://codespeak.net/pipermail/cython-dev/attachments/20110322/085281d0/attachment.diff From wstein at gmail.com Wed Mar 23 02:21:38 2011 From: wstein at gmail.com (William Stein) Date: Tue, 22 Mar 2011 18:21:38 -0700 Subject: [Cython] cython talk by Robert Bradshaw Message-ID: Hi, Robert Bradshaw gave a talk on Cython today at Sage Days 29: Youtube Video: http://www.youtube.com/watch?v=osjSS2Rrvm0 Slides: http://wiki.sagemath.org/days29?action=AttachFile&do=view&target=cython-days29.pdf -- William Stein Professor of Mathematics University of Washington http://wstein.org