Re: [Cython] Cython 0.14 Bugreport

2011-01-07 Thread Robert Bradshaw
On Thu, Jan 6, 2011 at 10:54 AM, Robert Bradshaw
rober...@math.washington.edu wrote:
 On Thu, Jan 6, 2011 at 10:48 AM, Vitja Makarov vitja.maka...@gmail.com 
 wrote:
 2011/1/6 Robert Bradshaw rober...@math.washington.edu:
 On Thu, Jan 6, 2011 at 10:30 AM, Stefan Behnel stefan...@behnel.de wrote:
 Daniel Norberg, 06.01.2011 12:20:
 I'm getting a curious error in Cython 0.14 when trying to compile this:

    def bar(foo):
        qux = foo
        quux = foo[qux.baz]

 The error message:

       $ cython bar.py

       Error compiling Cython file:
       
       ...
       def bar(foo):
               qux = foo
               quux = foo[qux.baz]
                     ^
       

       /Users/daniel/Desktop/cython-test/bar.py:3:15: Object of type 
 'unspecified' has no attribute 'baz'

 Cython 0.13 compiles this just fine. I also tried the latest revision of 
 cython-devel (b816b03ff502) and it fails.

 I can reproduce this. From a quick test, it seems like the type inference
 machinery processes 'quux' and 'qux' in the wrong order, i.e. 'quux' before
 'qux'. Anyone interested in taking a closer look?

 That shouldn't be happening, as it should know the inferred type of
 quux depends on the inferred type of qux. I'll take a look.

 - Robert
 ___
 Cython-dev mailing list
 Cython-dev@codespeak.net
 http://codespeak.net/mailman/listinfo/cython-dev


 Strange thing this code compiles:

 def bar(foo):
    qux = foo
    xquux = foo[qux.baz]

 but this doesn't:

 def bar(foo):
    qux = foo
    aquux = foo[qux.baz]

 Since it doesn't detect the dependency, half the time it'll get lucky
 (probably as a function of the variable names).

The problem was that the indexing operator inference was changed to
depend on the index type as well as the base type, but its
type_dependencies method wasn't updated to reflect this. Thanks for
catching that, fix at
https://github.com/cython/cython/commit/43a3dbea06e00bf6eb6592017964b79e35bae2d6

- Robert
___
Cython-dev mailing list
Cython-dev@codespeak.net
http://codespeak.net/mailman/listinfo/cython-dev


Re: [Cython] Cython 0.14 Bugreport

2011-01-06 Thread Stefan Behnel
Daniel Norberg, 06.01.2011 12:20:
 I'm getting a curious error in Cython 0.14 when trying to compile this:

def bar(foo):
qux = foo
quux = foo[qux.baz]

 The error message:

   $ cython bar.py

   Error compiling Cython file:
   
   ...
   def bar(foo):
   qux = foo
   quux = foo[qux.baz]
 ^
   

   /Users/daniel/Desktop/cython-test/bar.py:3:15: Object of type 
 'unspecified' has no attribute 'baz'

 Cython 0.13 compiles this just fine. I also tried the latest revision of 
 cython-devel (b816b03ff502) and it fails.

I can reproduce this. From a quick test, it seems like the type inference 
machinery processes 'quux' and 'qux' in the wrong order, i.e. 'quux' before 
'qux'. Anyone interested in taking a closer look?

Stefan
___
Cython-dev mailing list
Cython-dev@codespeak.net
http://codespeak.net/mailman/listinfo/cython-dev


Re: [Cython] Cython 0.14 Bugreport

2011-01-06 Thread Robert Bradshaw
On Thu, Jan 6, 2011 at 10:30 AM, Stefan Behnel stefan...@behnel.de wrote:
 Daniel Norberg, 06.01.2011 12:20:
 I'm getting a curious error in Cython 0.14 when trying to compile this:

    def bar(foo):
        qux = foo
        quux = foo[qux.baz]

 The error message:

       $ cython bar.py

       Error compiling Cython file:
       
       ...
       def bar(foo):
               qux = foo
               quux = foo[qux.baz]
                     ^
       

       /Users/daniel/Desktop/cython-test/bar.py:3:15: Object of type 
 'unspecified' has no attribute 'baz'

 Cython 0.13 compiles this just fine. I also tried the latest revision of 
 cython-devel (b816b03ff502) and it fails.

 I can reproduce this. From a quick test, it seems like the type inference
 machinery processes 'quux' and 'qux' in the wrong order, i.e. 'quux' before
 'qux'. Anyone interested in taking a closer look?

That shouldn't be happening, as it should know the inferred type of
quux depends on the inferred type of qux. I'll take a look.

- Robert
___
Cython-dev mailing list
Cython-dev@codespeak.net
http://codespeak.net/mailman/listinfo/cython-dev


Re: [Cython] Cython 0.14 Bugreport

2011-01-06 Thread Vitja Makarov
2011/1/6 Robert Bradshaw rober...@math.washington.edu:
 On Thu, Jan 6, 2011 at 10:30 AM, Stefan Behnel stefan...@behnel.de wrote:
 Daniel Norberg, 06.01.2011 12:20:
 I'm getting a curious error in Cython 0.14 when trying to compile this:

    def bar(foo):
        qux = foo
        quux = foo[qux.baz]

 The error message:

       $ cython bar.py

       Error compiling Cython file:
       
       ...
       def bar(foo):
               qux = foo
               quux = foo[qux.baz]
                     ^
       

       /Users/daniel/Desktop/cython-test/bar.py:3:15: Object of type 
 'unspecified' has no attribute 'baz'

 Cython 0.13 compiles this just fine. I also tried the latest revision of 
 cython-devel (b816b03ff502) and it fails.

 I can reproduce this. From a quick test, it seems like the type inference
 machinery processes 'quux' and 'qux' in the wrong order, i.e. 'quux' before
 'qux'. Anyone interested in taking a closer look?

 That shouldn't be happening, as it should know the inferred type of
 quux depends on the inferred type of qux. I'll take a look.

 - Robert
 ___
 Cython-dev mailing list
 Cython-dev@codespeak.net
 http://codespeak.net/mailman/listinfo/cython-dev


Strange thing this code compiles:

def bar(foo):
qux = foo
xquux = foo[qux.baz]

but this doesn't:

def bar(foo):
qux = foo
aquux = foo[qux.baz]

-- 
vitja.
___
Cython-dev mailing list
Cython-dev@codespeak.net
http://codespeak.net/mailman/listinfo/cython-dev


Re: [Cython] Cython 0.14 Bugreport

2011-01-06 Thread Robert Bradshaw
On Thu, Jan 6, 2011 at 10:48 AM, Vitja Makarov vitja.maka...@gmail.com wrote:
 2011/1/6 Robert Bradshaw rober...@math.washington.edu:
 On Thu, Jan 6, 2011 at 10:30 AM, Stefan Behnel stefan...@behnel.de wrote:
 Daniel Norberg, 06.01.2011 12:20:
 I'm getting a curious error in Cython 0.14 when trying to compile this:

    def bar(foo):
        qux = foo
        quux = foo[qux.baz]

 The error message:

       $ cython bar.py

       Error compiling Cython file:
       
       ...
       def bar(foo):
               qux = foo
               quux = foo[qux.baz]
                     ^
       

       /Users/daniel/Desktop/cython-test/bar.py:3:15: Object of type 
 'unspecified' has no attribute 'baz'

 Cython 0.13 compiles this just fine. I also tried the latest revision of 
 cython-devel (b816b03ff502) and it fails.

 I can reproduce this. From a quick test, it seems like the type inference
 machinery processes 'quux' and 'qux' in the wrong order, i.e. 'quux' before
 'qux'. Anyone interested in taking a closer look?

 That shouldn't be happening, as it should know the inferred type of
 quux depends on the inferred type of qux. I'll take a look.

 - Robert
 ___
 Cython-dev mailing list
 Cython-dev@codespeak.net
 http://codespeak.net/mailman/listinfo/cython-dev


 Strange thing this code compiles:

 def bar(foo):
    qux = foo
    xquux = foo[qux.baz]

 but this doesn't:

 def bar(foo):
    qux = foo
    aquux = foo[qux.baz]

Since it doesn't detect the dependency, half the time it'll get lucky
(probably as a function of the variable names).

- Robert
___
Cython-dev mailing list
Cython-dev@codespeak.net
http://codespeak.net/mailman/listinfo/cython-dev