Re: [Cython] Function calls and ref counts

2016-03-19 Thread John Ehresman

On 3/15/16 5:55 PM, Jeroen Demeyer wrote:

I cannot reproduce the problem...

It might be relevant to mention things like OS and Python version.


It may only crash in a pydebug build since freed memory isn't 
necessarily overwritten right away.  I tested with a pydebug build of 
Python 2.7 on OS X.


Thanks,

John

___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


[Cython] PEP 515: underscores in number literals

2016-03-19 Thread Stefan Behnel
Hi!

PEP 515 proposes to allow underscores in number literals to provide a
visual digit separator, e.g. for thousands, nibbles, hex-bytes/words, etc.

https://www.python.org/dev/peps/pep-0515/

I've implemented it for Cython:

https://github.com/cython/cython/pull/499

I think it's safe enough to still go into 0.24 as it only extends the
supported syntax, but I'll leave it to Robert to decide.

Stefan
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Cython alpha 0.24

2016-03-19 Thread Joshua


On Friday, March 11, 2016 at 3:24:26 AM UTC-5, Robert Bradshaw wrote:
>
> We are getting ready to push a new major release. A first alpha is up 
> at http://cython.org/release/Cython-0.24a0.tar.gz 
>
> To avoid surprises, please test and report. 
>
> Thanks, 
> Robert 
>


I ran across a compilation error using 0.24a1. It's actually the same error 
that I posted to the list a while back 
(https://groups.google.com/d/msg/cython-users/_ShPVfZAuKA/RxiS0dfRDwAJ), 
but at the time, I didn't have a minimal working example that had been 
extracted from a much more complicated project that I couldn't post 
publicly. 

I now have a minimal demonstration that I've posted here:
https://gist.github.com/synapticarbors/c6268e25ce22e4d04b4d

It fails on both OSX and Windows (using mingw) with traceback:

$ python setup.py build_ext -i
Compiling factors.pyx because it changed.
Compiling xlib.pyx because it changed.
[1/2] Cythonizing factors.pyx
[2/2] Cythonizing xlib.pyx
running build_ext
building 'factors' extension
creating build
creating build/temp.macosx-10.5-x86_64-2.7
gcc -fno-strict-aliasing -I/Users/lev/anaconda/envs/test-cython/include -arch 
x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -I/Users/lev/
anaconda/envs/test-cython/lib/python2.7/site-packages/numpy/core/include -I/
Users/lev/anaconda/envs/test-cython/include/python2.7 -c factors.c -o build/
temp.macosx-10.5-x86_64-2.7/factors.o -O3 -w
gcc -bundle -undefined dynamic_lookup -L/Users/lev/anaconda/envs/test-cython
/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.5-x86_64-2.7/factors.o -
L/Users/lev/anaconda/envs/test-cython/lib -o /Users/lev/Desktop/av4tmp/
cython-test/factors.so
building 'xlib' extension
gcc -fno-strict-aliasing -I/Users/lev/anaconda/envs/test-cython/include -arch 
x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -I/Users/lev/
anaconda/envs/test-cython/lib/python2.7/site-packages/numpy/core/include -I/
Users/lev/anaconda/envs/test-cython/include/python2.7 -c xlib.c -o build/
temp.macosx-10.5-x86_64-2.7/xlib.o -O3 -w
xlib.c:17371:63: error: too few arguments to function call, expected 3, 
have 1
__pyx_v_7factors_xarr0 = __Pyx_carray_from_py_xarr__type(o); if (
PyErr_Occurred()) __PYX_ERR(1, 13, __pyx_L2_error);
 ~~~  ^
xlib.c:4726:1: note: '__Pyx_carray_from_py_xarr__type' declared here
static int __Pyx_carray_from_py_xarr__type(PyObject *__pyx_v_o, struct 
__pyx_t_15data_structures_xarr_type *__py...
^
xlib.c:20424:13: error: static declaration of '__Pyx_BufFmt_Init' follows 
non-static declaration
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
^
xlib.c:20295:9: note: previous implicit declaration is here
__Pyx_BufFmt_Init(&ctx, stack, dtype);
^
xlib.c:20789:20: error: static declaration of '__Pyx_BufFmt_CheckString' 
follows non-static declaration
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const 
char* ts) {
   ^
xlib.c:20296:14: note: previous implicit declaration is here
if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
 ^
3 errors generated.
error: command 'gcc' failed with exit status 1

It fails similarly with Cython 0.23.4. It compiles without error using 
Cython 0.22.1, which is what I'm using in production. 

It looks like a possible codegen error to me since the function call 
doesn't match the prototype, but it's deep enough in the cython internals 
that I'll defer to a Cython developer.

Any help with this would be very much appreciated.

Thanks,
Josh
 
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Cython alpha 0.24

2016-03-19 Thread Jason Madden
gevent compiles and passes all its tests with this release.

However, compilation produces 420 warnings of the form:

  warning: gevent/corecext.pyx:1893:4: 'property rpid:' syntax is
deprecated, use '@property'

That's a lot of warnings.

As I understand it, this was added with pull #462 which is only in
master/0.24, so there

On Fri, Mar 11, 2016 at 2:23 AM, Robert Bradshaw  wrote:

> We are getting ready to push a new major release. A first alpha is up
> at http://cython.org/release/Cython-0.24a0.tar.gz
>
> To avoid surprises, please test and report.
>
> Thanks,
> Robert
> ___
> cython-devel mailing list
> cython-devel@python.org
> https://mail.python.org/mailman/listinfo/cython-devel
>
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Cython alpha 0.24

2016-03-19 Thread Jason Madden
[Ack, really sorry for the premature send. Here's the whole thing:]

gevent compiles and passes all its tests with this release.

However, compilation produces 420 warnings of the form:

  warning: gevent/corecext.pyx:1893:4: 'property rpid:' syntax is
deprecated, use '@property'

That's a lot of warnings.

There's also this comment in the code, which seems to indicate that the
warnings aren't actually desired, but the test for it includes `if True:`
so warnings are always emitted.  I'm a bit confused as to the intent; are
the warnings going to be in the final release?

def visit_PropertyNode(self, node):
# Suppress warning for our code until we can convert all our uses
over.
if isinstance(node.pos[0], str) or True:
warning(node.pos, "'property %s:' syntax is deprecated, use
'@property'" % node.name, 2)

As I understand it, this was added with pull #462 which is only in
master/0.24, so there's no way for me to fix these warnings while still
being able to compile on 0.23; is that right? (That is, @property doesn't
work right in 0.23) If so, this would seem to at least merit a mention in
CHANGES.rst?

Thanks,
jason

On Sat, Mar 19, 2016 at 9:44 AM, Jason Madden 
wrote:

> gevent compiles and passes all its tests with this release.
>
> However, compilation produces 420 warnings of the form:
>
>   warning: gevent/corecext.pyx:1893:4: 'property rpid:' syntax is
> deprecated, use '@property'
>
> That's a lot of warnings.
>
> As I understand it, this was added with pull #462 which is only in
> master/0.24, so there
>
>
> On Fri, Mar 11, 2016 at 2:23 AM, Robert Bradshaw 
> wrote:
>
>> We are getting ready to push a new major release. A first alpha is up
>> at http://cython.org/release/Cython-0.24a0.tar.gz
>>
>> To avoid surprises, please test and report.
>>
>> Thanks,
>> Robert
>> ___
>> cython-devel mailing list
>> cython-devel@python.org
>> https://mail.python.org/mailman/listinfo/cython-devel
>>
>
>
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Cython alpha 0.24

2016-03-19 Thread Robert Bradshaw
On Sat, Mar 19, 2016 at 7:51 AM, Jason Madden
 wrote:
> [Ack, really sorry for the premature send. Here's the whole thing:]
>
> gevent compiles and passes all its tests with this release.
>
> However, compilation produces 420 warnings of the form:
>
>   warning: gevent/corecext.pyx:1893:4: 'property rpid:' syntax is
> deprecated, use '@property'
>
> That's a lot of warnings.
>
> There's also this comment in the code, which seems to indicate that the
> warnings aren't actually desired, but the test for it includes `if True:` so
> warnings are always emitted.  I'm a bit confused as to the intent; are the
> warnings going to be in the final release?
>
> def visit_PropertyNode(self, node):
> # Suppress warning for our code until we can convert all our uses
> over.
> if isinstance(node.pos[0], str) or True:
> warning(node.pos, "'property %s:' syntax is deprecated, use
> '@property'" % node.name, 2)
>
> As I understand it, this was added with pull #462 which is only in
> master/0.24, so there's no way for me to fix these warnings while still
> being able to compile on 0.23; is that right? (That is, @property doesn't
> work right in 0.23) If so, this would seem to at least merit a mention in
> CHANGES.rst?

Good point. I've lowered the warning to invisible-by-default for now
and added a note in CHANGES.rst.

> On Sat, Mar 19, 2016 at 9:44 AM, Jason Madden 
> wrote:
>>
>> gevent compiles and passes all its tests with this release.
>>
>> However, compilation produces 420 warnings of the form:
>>
>>   warning: gevent/corecext.pyx:1893:4: 'property rpid:' syntax is
>> deprecated, use '@property'
>>
>> That's a lot of warnings.
>>
>> As I understand it, this was added with pull #462 which is only in
>> master/0.24, so there
>>
>>
>> On Fri, Mar 11, 2016 at 2:23 AM, Robert Bradshaw 
>> wrote:
>>>
>>> We are getting ready to push a new major release. A first alpha is up
>>> at http://cython.org/release/Cython-0.24a0.tar.gz
>>>
>>> To avoid surprises, please test and report.
>>>
>>> Thanks,
>>> Robert
>>> ___
>>> cython-devel mailing list
>>> cython-devel@python.org
>>> https://mail.python.org/mailman/listinfo/cython-devel
>>
>>
>
>
> ___
> cython-devel mailing list
> cython-devel@python.org
> https://mail.python.org/mailman/listinfo/cython-devel
>
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel