Re: [Cython] Shared Cython runtime

2013-04-10 Thread Nikita Nemkin
On Wed, 10 Apr 2013 12:57:48 +0600, Stefan Behnel   
wrote:



Nikita Nemkin, 10.04.2013 08:44:

Well, here is the workaround Cython can use:
https://gist.github.com/nnemkin/5352088
(Warning: I haven't fully tested it yet).


Interesting. Looks like that could help here, yes. Do you know if it also
works for statically linked binaries? (i.e. would it return the name of  
the

executable in that case?)


It will return the executable name, but correct behavior for
statically linked modules is to not have __file__ attribute at all.

There is probably a #define that tells when the module is compiled
statically, I just haven't looked into it yet.


Best regards,
Nikita Nemkin
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


[Cython] Bug(?): chained assignments and tuple unpacking

2013-04-10 Thread Alok Singhal
Hi,

The following code (also attached as a .pyx file) fails in the current
Cython :

cdef class test:
pass

def main():
cdef test a, b, c, d
(a, b) = (c, d) = (None, None)

When run, I get the following traceback:

In [1]: import assign_test
In [2]: assign_test.main()
Traceback (most recent call last):
  File "", line 1, in 
assign_test.main()
  File "assign_test.pyx", line 6, in assign_test.main (assign_test.c:669)
(a, b) = (c, d) = (None, None)
TypeError: Cannot convert NoneType to assign_test.test

I am using the latest Cython development version (from github).  Also
tested with Cython 0.18.

$ git rev-parse HEAD
e8bd1789905a58d8224e4be5019be401f360aa54

I don't get an error when I change the assignments to either:

(a, b) = (None, None)

or

a = b = None

Is this a bug in Cython?  I tried doing a git bisect and it seems like
commit ea6a71acb5c79afb080855be1cb6ca30d283ec25 is when the above code
started failing (It works with the previous commit).

Thanks,
Alok


assign_test.pyx
Description: Binary data
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Bug(?): chained assignments and tuple unpacking

2013-04-10 Thread Robert Bradshaw
Thanks for the detailed report. This does look like a bug.

On Wed, Apr 10, 2013 at 1:36 PM, Alok Singhal  wrote:
> Hi,
>
> The following code (also attached as a .pyx file) fails in the current
> Cython :
>
> cdef class test:
> pass
>
> def main():
> cdef test a, b, c, d
> (a, b) = (c, d) = (None, None)
>
> When run, I get the following traceback:
>
> In [1]: import assign_test
> In [2]: assign_test.main()
> Traceback (most recent call last):
>   File "", line 1, in 
> assign_test.main()
>   File "assign_test.pyx", line 6, in assign_test.main (assign_test.c:669)
> (a, b) = (c, d) = (None, None)
> TypeError: Cannot convert NoneType to assign_test.test
>
> I am using the latest Cython development version (from github).  Also tested
> with Cython 0.18.
>
> $ git rev-parse HEAD
> e8bd1789905a58d8224e4be5019be401f360aa54
>
> I don't get an error when I change the assignments to either:
>
> (a, b) = (None, None)
>
> or
>
> a = b = None
>
> Is this a bug in Cython?  I tried doing a git bisect and it seems like
> commit ea6a71acb5c79afb080855be1cb6ca30d283ec25 is when the above code
> started failing (It works with the previous commit).
>
> Thanks,
> Alok
>
> ___
> cython-devel mailing list
> cython-devel@python.org
> http://mail.python.org/mailman/listinfo/cython-devel
>
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel