Re: [Cython] CF based type inference

2013-06-02 Thread mark florisson
On 2 June 2013 07:22, Stefan Behnel wrote: > mark florisson, 21.05.2013 15:32: >> On 21 May 2013 14:14, Vitja Makarov wrote: >>> >>> def foo(int N): >>> x = 1 >>> y = 0 >>> for i in range(N): >>> x = x * 0.1 + y * 0.2 >>> y = x * 0.3 + y * 0.4 >>> print typeof(x), t

Re: [Cython] CF based type inference

2013-06-02 Thread Nathaniel Smith
On Sun, Jun 2, 2013 at 7:22 AM, Stefan Behnel wrote: > mark florisson, 21.05.2013 15:32: >> On 21 May 2013 14:14, Vitja Makarov wrote: >>> >>> def foo(int N): >>> x = 1 >>> y = 0 >>> for i in range(N): >>> x = x * 0.1 + y * 0.2 >>> y = x * 0.3 + y * 0.4 >>> print ty

Re: [Cython] CF based type inference

2013-06-01 Thread Stefan Behnel
mark florisson, 21.05.2013 15:32: > On 21 May 2013 14:14, Vitja Makarov wrote: >> >> def foo(int N): >> x = 1 >> y = 0 >> for i in range(N): >> x = x * 0.1 + y * 0.2 >> y = x * 0.3 + y * 0.4 >> print typeof(x), typeof(y) >> >> Here both x and y will be inferred as do

Re: [Cython] CF based type inference

2013-05-21 Thread Vitja Makarov
2013/5/21 mark florisson > On 21 May 2013 14:41, Vitja Makarov wrote: > > > > > > > > 2013/5/21 mark florisson > >> > >> On 21 May 2013 14:14, Vitja Makarov wrote: > >> > > >> > > >> > > >> > 2013/5/21 mark florisson > >> >> > >> >> On 21 May 2013 11:26, Vitja Makarov wrote: > >> >> > Hi! >

Re: [Cython] CF based type inference

2013-05-21 Thread mark florisson
On 21 May 2013 14:41, Vitja Makarov wrote: > > > > 2013/5/21 mark florisson >> >> On 21 May 2013 14:14, Vitja Makarov wrote: >> > >> > >> > >> > 2013/5/21 mark florisson >> >> >> >> On 21 May 2013 11:26, Vitja Makarov wrote: >> >> > Hi! >> >> > >> >> > Recently I've started work on new type in

Re: [Cython] CF based type inference

2013-05-21 Thread Vitja Makarov
2013/5/21 mark florisson > On 21 May 2013 14:14, Vitja Makarov wrote: > > > > > > > > 2013/5/21 mark florisson > >> > >> On 21 May 2013 11:26, Vitja Makarov wrote: > >> > Hi! > >> > > >> > Recently I've started work on new type inference engine. Now it's > almost > >> > ready and I want to dis

Re: [Cython] CF based type inference

2013-05-21 Thread mark florisson
On 21 May 2013 14:14, Vitja Makarov wrote: > > > > 2013/5/21 mark florisson >> >> On 21 May 2013 11:26, Vitja Makarov wrote: >> > Hi! >> > >> > Recently I've started work on new type inference engine. Now it's almost >> > ready and I want to discuss it. >> > >> > It works like this: first infer

Re: [Cython] CF based type inference

2013-05-21 Thread Vitja Makarov
2013/5/21 mark florisson > On 21 May 2013 11:26, Vitja Makarov wrote: > > Hi! > > > > Recently I've started work on new type inference engine. Now it's almost > > ready and I want to discuss it. > > > > It works like this: first infer type for each assignment then for whole > > entry. It has som

Re: [Cython] CF based type inference

2013-05-21 Thread mark florisson
On 21 May 2013 11:26, Vitja Makarov wrote: > Hi! > > Recently I've started work on new type inference engine. Now it's almost > ready and I want to discuss it. > > It works like this: first infer type for each assignment then for whole > entry. It has some advantages over previous algorithm: > -

[Cython] CF based type inference

2013-05-21 Thread Vitja Makarov
Hi! Recently I've started work on new type inference engine. Now it's almost ready and I want to discuss it. It works like this: first infer type for each assignment then for whole entry. It has some advantages over previous algorithm: - it handles assignment cycles, see test_swap() for example

Re: [Cython] CF based type inference

2012-05-11 Thread Robert Bradshaw
On Fri, May 11, 2012 at 8:56 AM, Stefan Behnel wrote: > Robert Bradshaw, 11.05.2012 17:48: >> On Tue, May 8, 2012 at 11:22 PM, Stefan Behnel wrote: >>> 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 rebas

Re: [Cython] CF based type inference

2012-05-11 Thread Stefan Behnel
Robert Bradshaw, 11.05.2012 17:48: > On Tue, May 8, 2012 at 11:22 PM, Stefan Behnel wrote: >> 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

Re: [Cython] CF based type inference

2012-05-11 Thread Robert Bradshaw
On Tue, May 8, 2012 at 11:22 PM, Stefan Behnel wrote: > 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 th

Re: [Cython] CF based type inference

2012-05-10 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-10 Thread mark florisson
On 10 May 2012 08:27, Vitja Makarov wrote: > 2012/5/10 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(): >

Re: [Cython] CF based type inference

2012-05-10 Thread Vitja Makarov
2012/5/10 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() >>>    ('Pyt

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] 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] 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] 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] 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] 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] 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] CF based type inference

2012-05-08 Thread 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_validity(): >>>""" >>>>>> pa

Re: [Cython] CF based type inference

2012-05-08 Thread Robert Bradshaw
On Tue, May 8, 2012 at 6:47 AM, Vitja Makarov wrote: > 2012/5/8 Stefan Behnel : >> Hi, >> >> 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

Re: [Cython] CF based type inference

2012-05-08 Thread Dag Sverre Seljebotn
Vitja Makarov wrote: >2012/5/8 Stefan Behnel : >> Hi, >> >> 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 objec

Re: [Cython] CF based type inference

2012-05-08 Thread Vitja Makarov
2012/5/8 Stefan Behnel : > Hi, > > 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') >    """ >    a = 1.0 >    b = a

[Cython] CF based type inference

2012-05-08 Thread Stefan Behnel
Hi, 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') """ a = 1.0 b = a + 2 # definitely double a = 'test