Re: [Cython] CF based type inference

2012-05-09 Thread Stefan Behnel
Vitja Makarov, 08.05.2012 15:47: > 2012/5/8 Stefan Behnel: >> Vitja has rebased the type inference on the control flow, so I wonder if >> this will enable us to properly infer this: >> >> def partial_validity(): >>""" >>>>> partial_validity() >>('Python object', 'double', 'str object')

Re: [Cython] buffer syntax vs. memory view syntax

2012-05-09 Thread Robert Bradshaw
On Wed, May 9, 2012 at 12:09 PM, mark florisson wrote: > On 9 May 2012 20:08, mark florisson wrote: >> On 9 May 2012 19:56, Robert Bradshaw wrote: >>> On Tue, May 8, 2012 at 3:35 AM, mark florisson >>> wrote: On 8 May 2012 10:47, Dag Sverre Seljebotn wrote: > > After some th

Re: [Cython] buffer syntax vs. memory view syntax

2012-05-09 Thread mark florisson
On 9 May 2012 20:08, mark florisson wrote: > On 9 May 2012 19:56, Robert Bradshaw wrote: >> On Tue, May 8, 2012 at 3:35 AM, mark florisson >> wrote: >>> On 8 May 2012 10:47, Dag Sverre Seljebotn >>> wrote: After some thinking I believe I can see more clearly where Mark is coming

Re: [Cython] buffer syntax vs. memory view syntax

2012-05-09 Thread mark florisson
On 9 May 2012 19:56, Robert Bradshaw wrote: > On Tue, May 8, 2012 at 3:35 AM, mark florisson > wrote: >> On 8 May 2012 10:47, Dag Sverre Seljebotn wrote: >>> >>> After some thinking I believe I can see more clearly where Mark is coming >>> from. To sum up, it's either >>> >>> A) Keep both np.nda

Re: [Cython] buffer syntax vs. memory view syntax

2012-05-09 Thread mark florisson
On 9 May 2012 19:55, Stefan Behnel wrote: > mark florisson, 09.05.2012 20:45: >> You can also use newaxis indexing or transpose the view > > What is "newaxis indexing"? > > Stefan > ___ > cython-devel mailing list > cython-devel@python.org > http://mail.

Re: [Cython] buffer syntax vs. memory view syntax

2012-05-09 Thread Robert Bradshaw
On Tue, May 8, 2012 at 3:35 AM, mark florisson wrote: > On 8 May 2012 10:47, Dag Sverre Seljebotn wrote: >> >> After some thinking I believe I can see more clearly where Mark is coming >> from. To sum up, it's either >> >> A) Keep both np.ndarray[double] and double[:] around, with clearly defined

Re: [Cython] buffer syntax vs. memory view syntax

2012-05-09 Thread Stefan Behnel
mark florisson, 09.05.2012 20:45: > You can also use newaxis indexing or transpose the view What is "newaxis indexing"? Stefan ___ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel

Re: [Cython] buffer syntax vs. memory view syntax

2012-05-09 Thread mark florisson
On 9 May 2012 19:35, Robert Bradshaw wrote: > On Tue, May 8, 2012 at 2:48 AM, Stefan Behnel wrote: >> mark florisson, 08.05.2012 11:24: >> Dag Sverre Seljebotn, 08.05.2012 09:57: >>>  1) We NEVER deprecate "np.ndarray[double]", we commit to keeping that >>> in >>> the language. I

Re: [Cython] buffer syntax vs. memory view syntax

2012-05-09 Thread Robert Bradshaw
On Tue, May 8, 2012 at 2:48 AM, Stefan Behnel wrote: > mark florisson, 08.05.2012 11:24: > Dag Sverre Seljebotn, 08.05.2012 09:57: >>  1) We NEVER deprecate "np.ndarray[double]", we commit to keeping that in >> the language. It means exactly what you would like double[:] to mean, >

Re: [Cython] CF based type inference

2012-05-09 Thread Vitja Makarov
2012/5/9 Robert Bradshaw : > On Wed, May 9, 2012 at 6:33 AM, Stefan Behnel wrote: >> mark florisson, 09.05.2012 15:18: >>> On 9 May 2012 14:16, Vitja Makarov wrote: from cython cimport typeof def foo(float[::1] a):    b = a    #del b    print typeof(b)    print t

Re: [Cython] CF based type inference

2012-05-09 Thread Robert Bradshaw
On Wed, May 9, 2012 at 6:33 AM, Stefan Behnel wrote: > mark florisson, 09.05.2012 15:18: >> On 9 May 2012 14:16, Vitja Makarov wrote: >>> from cython cimport typeof >>> >>> def foo(float[::1] a): >>>    b = a >>>    #del b >>>    print typeof(b) >>>    print typeof(a) >>> >>> >>> In this example `

Re: [Cython] Bug in print statement

2012-05-09 Thread Vitja Makarov
2012/5/9 Stefan Behnel : > Vitja Makarov, 09.05.2012 18:31: >> Del statement inference enabled pyregr.test_descr testcase and it SIGSEGVs. >> Here is minimal example: >> >> import unittest >> import sys >> >> class Foo(unittest.TestCase): >>     def test_file_fault(self): >>         # Testing sys.s

Re: [Cython] Bug in print statement

2012-05-09 Thread Stefan Behnel
Vitja Makarov, 09.05.2012 18:31: > Del statement inference enabled pyregr.test_descr testcase and it SIGSEGVs. > Here is minimal example: > > import unittest > import sys > > class Foo(unittest.TestCase): > def test_file_fault(self): > # Testing sys.stdout is changed in getattr... >

[Cython] Bug in print statement

2012-05-09 Thread Vitja Makarov
Del statement inference enabled pyregr.test_descr testcase and it SIGSEGVs. Here is minimal example: import unittest import sys class Foo(unittest.TestCase): def test_file_fault(self): # Testing sys.stdout is changed in getattr... test_stdout = sys.stdout class StdoutG

Re: [Cython] CF based type inference

2012-05-09 Thread Dag Sverre Seljebotn
On 05/09/2012 05:13 PM, Stefan Behnel wrote: Dag Sverre Seljebotn, 08.05.2012 18:52: Vitja Makarov wrote: def partial_validity(): """ >>> partial_validity() ('str object', 'double', 'str object') """ a_1 = 1.0 b = a_1 + 2 # definitely double a_2 = 'test' c = a_2 + 'to

Re: [Cython] CF based type inference

2012-05-09 Thread mark florisson
On 9 May 2012 16:13, Stefan Behnel wrote: > Dag Sverre Seljebotn, 08.05.2012 18:52: >> Vitja Makarov wrote: >>> def partial_validity(): >>>   """ >>>   >>> partial_validity() >>>   ('str object', 'double', 'str object') >>>   """ >>>   a_1 = 1.0 >>>   b = a_1 + 2   # definitely double >>>   a_2 =

Re: [Cython] CF based type inference

2012-05-09 Thread Stefan Behnel
Dag Sverre Seljebotn, 08.05.2012 18:52: > Vitja Makarov wrote: >> def partial_validity(): >> """ >> >>> partial_validity() >> ('str object', 'double', 'str object') >> """ >> a_1 = 1.0 >> b = a_1 + 2 # definitely double >> a_2 = 'test' >> c = a_2 + 'toast' # definitely str >> r

Re: [Cython] CF based type inference

2012-05-09 Thread Stefan Behnel
mark florisson, 09.05.2012 15:18: > On 9 May 2012 14:16, Vitja Makarov wrote: >> from cython cimport typeof >> >> def foo(float[::1] a): >>b = a >>#del b >>print typeof(b) >>print typeof(a) >> >> >> In this example `b` is inferred as 'Python object' and not >> `float[::1]`, is that

Re: [Cython] CF based type inference

2012-05-09 Thread Stefan Behnel
Vitja Makarov, 09.05.2012 15:16: > 2012/5/9 Vitja Makarov: On 9 May 2012 13:39, Vitja Makarov wrote: > 2012/5/9 Vitja Makarov: >> 2012/5/9 Stefan Behnel: >>> def test(): >>> x = 1# inferred as int >>> del x# error: Deletion of non-Python, non-C++ object >

Re: [Cython] CF based type inference

2012-05-09 Thread mark florisson
On 9 May 2012 14:16, Vitja Makarov wrote: > 2012/5/9 Vitja Makarov : >> 2012/5/9 Vitja Makarov : >>> 2012/5/9 mark florisson : On 9 May 2012 13:39, Vitja Makarov wrote: > 2012/5/9 Vitja Makarov : >> 2012/5/9 Stefan Behnel : >>> Stefan Behnel, 08.05.2012 14:24: Vitja has

Re: [Cython] CF based type inference

2012-05-09 Thread Vitja Makarov
2012/5/9 Vitja Makarov : > 2012/5/9 Vitja Makarov : >> 2012/5/9 mark florisson : >>> On 9 May 2012 13:39, Vitja Makarov wrote: 2012/5/9 Vitja Makarov : > 2012/5/9 Stefan Behnel : >> Stefan Behnel, 08.05.2012 14:24: >>> Vitja has rebased the type inference on the control flow >

Re: [Cython] CF based type inference

2012-05-09 Thread Vitja Makarov
2012/5/9 Vitja Makarov : > 2012/5/9 mark florisson : >> On 9 May 2012 13:39, Vitja Makarov wrote: >>> 2012/5/9 Vitja Makarov : 2012/5/9 Stefan Behnel : > Stefan Behnel, 08.05.2012 14:24: >> Vitja has rebased the type inference on the control flow > > On a related note, is this

Re: [Cython] CF based type inference

2012-05-09 Thread Vitja Makarov
2012/5/9 mark florisson : > On 9 May 2012 13:39, Vitja Makarov wrote: >> 2012/5/9 Vitja Makarov : >>> 2012/5/9 Stefan Behnel : Stefan Behnel, 08.05.2012 14:24: > Vitja has rebased the type inference on the control flow On a related note, is this fixable now?  def test(

Re: [Cython] CF based type inference

2012-05-09 Thread mark florisson
On 9 May 2012 13:39, Vitja Makarov wrote: > 2012/5/9 Vitja Makarov : >> 2012/5/9 Stefan Behnel : >>> Stefan Behnel, 08.05.2012 14:24: Vitja has rebased the type inference on the control flow >>> >>> On a related note, is this fixable now? >>> >>>  def test(): >>>      x = 1    # inferred as i

Re: [Cython] CF based type inference

2012-05-09 Thread Vitja Makarov
2012/5/9 Vitja Makarov : > 2012/5/9 Stefan Behnel : >> Stefan Behnel, 08.05.2012 14:24: >>> Vitja has rebased the type inference on the control flow >> >> On a related note, is this fixable now? >> >>  def test(): >>      x = 1    # inferred as int >>      del x    # error: Deletion of non-Python,

Re: [Cython] CF based type inference

2012-05-09 Thread Vitja Makarov
2012/5/9 Stefan Behnel : > Stefan Behnel, 08.05.2012 14:24: >> Vitja has rebased the type inference on the control flow > > On a related note, is this fixable now? > >  def test(): >      x = 1    # inferred as int >      del x    # error: Deletion of non-Python, non-C++ object > > http://trac.cyth

Re: [Cython] 0.17

2012-05-09 Thread Stefan Behnel
mark florisson, 06.05.2012 16:28: > I think we already have quite a bit of functionality (nearly) ready, > after merging some pending pull requests maybe it will be a good time > for a 0.17 release? I think it would be good to also document to what > extent pypy support works, what works and what d

Re: [Cython] CF based type inference

2012-05-09 Thread Stefan Behnel
Stefan Behnel, 08.05.2012 14:24: > Vitja has rebased the type inference on the control flow On a related note, is this fixable now? def test(): x = 1# inferred as int del x# error: Deletion of non-Python, non-C++ object http://trac.cython.org/cython_trac/ticket/768 It migh

Re: [Cython] 0.17

2012-05-09 Thread Stefan Behnel
Stefan Behnel, 06.05.2012 20:22: > Dag Sverre Seljebotn, 06.05.2012 19:51: >> On 05/06/2012 04:28 PM, mark florisson wrote: >>> I think we already have quite a bit of functionality (nearly) ready, >>> after merging some pending pull requests maybe it will be a good time >>> for a 0.17 release? I th

Re: [Cython] 0.16.1

2012-05-09 Thread Stefan Behnel
Stefan Behnel, 09.05.2012 10:51: > Stefan Behnel, 09.05.2012 08:41: >> Robert Bradshaw, 09.05.2012 00:16: >>> If we're looking at doing 0.17 soon, lets just do that. >> >> I think it's close enough to be released. I'll try to get around to list >> the changes in the release notes (and maybe even ad

Re: [Cython] 0.16.1

2012-05-09 Thread Stefan Behnel
Stefan Behnel, 09.05.2012 08:41: > Robert Bradshaw, 09.05.2012 00:16: >> If we're looking at doing 0.17 soon, lets just do that. > > I think it's close enough to be released. I'll try to get around to list > the changes in the release notes (and maybe even add a note about alpha > quality PyPy sup

Re: [Cython] callable() optimization

2012-05-09 Thread Vitja Makarov
2012/5/9 Stefan Behnel : > Vitja Makarov, 09.05.2012 10:21: >> 2012/5/9 Stefan Behnel : >>> Vitja Makarov, 09.05.2012 09:43: 2012/5/9 Stefan Behnel : > Vitja Makarov, 08.05.2012 13:27: >> I've noticed regression related to callable() optimization. >> >> https://github.com/cytho

Re: [Cython] callable() optimization

2012-05-09 Thread Stefan Behnel
mark florisson, 09.05.2012 10:37: > On 9 May 2012 09:02, Stefan Behnel wrote: >> Vitja Makarov, 09.05.2012 09:43: >>> 2012/5/9 Stefan Behnel : Vitja Makarov, 08.05.2012 13:27: > I've noticed regression related to callable() optimization. > > https://github.com/cython/cython/commit

Re: [Cython] CF based type inference

2012-05-09 Thread mark florisson
On 9 May 2012 09:28, mark florisson wrote: > On 9 May 2012 09:02, Vitja Makarov wrote: >> 2012/5/9 Stefan Behnel : >>> Robert Bradshaw, 09.05.2012 00:12: On Tue, May 8, 2012 at 6:47 AM, Vitja Makarov wrote: > 2012/5/8 Stefan Behnel: >> Vitja has rebased the type inference on the cont

Re: [Cython] callable() optimization

2012-05-09 Thread mark florisson
On 9 May 2012 09:02, Stefan Behnel wrote: > Vitja Makarov, 09.05.2012 09:43: >> 2012/5/9 Stefan Behnel : >>> Vitja Makarov, 08.05.2012 13:27: I've noticed regression related to callable() optimization. https://github.com/cython/cython/commit/a40112b0461eae5ab22fbdd07ae798d4a72ff523

Re: [Cython] callable() optimization

2012-05-09 Thread Stefan Behnel
Vitja Makarov, 09.05.2012 10:21: > 2012/5/9 Stefan Behnel : >> Vitja Makarov, 09.05.2012 09:43: >>> 2012/5/9 Stefan Behnel : Vitja Makarov, 08.05.2012 13:27: > I've noticed regression related to callable() optimization. > > https://github.com/cython/cython/commit/a40112b0461eae5ab2

Re: [Cython] 0.16.1

2012-05-09 Thread mark florisson
On 9 May 2012 08:49, Stefan Behnel wrote: > Stefan Behnel, 09.05.2012 08:41: >> Robert Bradshaw, 09.05.2012 00:16: >>> If we're looking at doing 0.17 soon, lets just do that. >> I think it's close enough to be released. > > ... although one thing I just noticed is that the "numpy_memoryview" test

Re: [Cython] 0.16.1

2012-05-09 Thread mark florisson
On 9 May 2012 07:41, Stefan Behnel wrote: > Robert Bradshaw, 09.05.2012 00:16: >> On Tue, May 8, 2012 at 12:04 PM, Vitja Makarov wrote: >>> 2012/5/8 mark florisson: On 8 May 2012 19:36, mark florisson wrote: > Ok, so for the bugfix release 0.16.1 I propose that everyone cherry > picks

Re: [Cython] CF based type inference

2012-05-09 Thread mark florisson
On 9 May 2012 09:02, Vitja Makarov wrote: > 2012/5/9 Stefan Behnel : >> Robert Bradshaw, 09.05.2012 00:12: >>> On Tue, May 8, 2012 at 6:47 AM, Vitja Makarov wrote: 2012/5/8 Stefan Behnel: > Vitja has rebased the type inference on the control flow, so I wonder if > this will enable us

Re: [Cython] callable() optimization

2012-05-09 Thread Vitja Makarov
2012/5/9 Stefan Behnel : > Vitja Makarov, 09.05.2012 09:43: >> 2012/5/9 Stefan Behnel : >>> Vitja Makarov, 08.05.2012 13:27: I've noticed regression related to callable() optimization. https://github.com/cython/cython/commit/a40112b0461eae5ab22fbdd07ae798d4a72ff523 class C:

Re: [Cython] callable() optimization

2012-05-09 Thread Stefan Behnel
Vitja Makarov, 09.05.2012 09:43: > 2012/5/9 Stefan Behnel : >> Vitja Makarov, 08.05.2012 13:27: >>> I've noticed regression related to callable() optimization. >>> >>> https://github.com/cython/cython/commit/a40112b0461eae5ab22fbdd07ae798d4a72ff523 >>> >>> class C: >>> pass >>> print callable(C

Re: [Cython] CF based type inference

2012-05-09 Thread Vitja Makarov
2012/5/9 Stefan Behnel : > Robert Bradshaw, 09.05.2012 00:12: >> On Tue, May 8, 2012 at 6:47 AM, Vitja Makarov wrote: >>> 2012/5/8 Stefan Behnel: Vitja has rebased the type inference on the control flow, so I wonder if this will enable us to properly infer this:  def partial_val

Re: [Cython] 0.16.1

2012-05-09 Thread Stefan Behnel
Stefan Behnel, 09.05.2012 08:41: > Robert Bradshaw, 09.05.2012 00:16: >> If we're looking at doing 0.17 soon, lets just do that. > I think it's close enough to be released. ... although one thing I just noticed is that the "numpy_memoryview" test is still disabled because it lead to crashes in rec

Re: [Cython] callable() optimization

2012-05-09 Thread Vitja Makarov
2012/5/9 Stefan Behnel : > Vitja Makarov, 08.05.2012 13:27: >> I've noticed regression related to callable() optimization. >> >> https://github.com/cython/cython/commit/a40112b0461eae5ab22fbdd07ae798d4a72ff523 >> >> class C: >>     pass >> print callable(C()) >> >> It prints True optimized version

Re: [Cython] callable() optimization

2012-05-09 Thread Stefan Behnel
Vitja Makarov, 08.05.2012 13:27: > I've noticed regression related to callable() optimization. > > https://github.com/cython/cython/commit/a40112b0461eae5ab22fbdd07ae798d4a72ff523 > > class C: > pass > print callable(C()) > > It prints True optimized version checks ((obj)->ob_type->tp_call !