[Cython] "minierror" in Shadow.py?

2013-01-19 Thread Stefan Behnel
Hi,

I just wanted to release 0.18 beta1 when I noticed this code in Shadow.py,
function index_type():

"""
raise minierror.InvalidTypeSpecification(
"Only a step of 1 may be provided to indicate C or "
"Fortran contiguity")
"""

There is no import "minierror" and the comments seem to indicate that this
is mostly a copy&paste oversight from code in minivect. Can this function
(and the other changes in that file that came in the same commit) be
removed from the 0.18 branch or are they needed for something?

https://github.com/cython/cython/commit/b9a2c953974c4ebc4aa37e7e64d642ce117337fb

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


Re: [Cython] "minierror" in Shadow.py?

2013-01-19 Thread mark florisson
On 19 January 2013 07:22, Stefan Behnel  wrote:
> Hi,
>
> I just wanted to release 0.18 beta1 when I noticed this code in Shadow.py,
> function index_type():
>
> """
> raise minierror.InvalidTypeSpecification(
> "Only a step of 1 may be provided to indicate C or "
> "Fortran contiguity")
> """
>
> There is no import "minierror" and the comments seem to indicate that this
> is mostly a copy&paste oversight from code in minivect. Can this function
> (and the other changes in that file that came in the same commit) be
> removed from the 0.18 branch or are they needed for something?
>
> https://github.com/cython/cython/commit/b9a2c953974c4ebc4aa37e7e64d642ce117337fb
>
> Stefan
> ___
> cython-devel mailing list
> cython-devel@python.org
> http://mail.python.org/mailman/listinfo/cython-devel

Hey Stefan,

Those changes are needed to support specifying memoryviews from pure
python. This is useful for instance to select a memoryview
specialization of a def function from Python.

I think the fix is to just define that exception and remove the
reference to minierror.

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


Re: [Cython] "minierror" in Shadow.py?

2013-01-19 Thread Stefan Behnel
mark florisson, 19.01.2013 19:46:
> On 19 January 2013 07:22, Stefan Behnel wrote:
>> I just wanted to release 0.18 beta1 when I noticed this code in Shadow.py,
>> function index_type():
>>
>> """
>> raise minierror.InvalidTypeSpecification(
>> "Only a step of 1 may be provided to indicate C or "
>> "Fortran contiguity")
>> """
>>
>> There is no import "minierror" and the comments seem to indicate that this
>> is mostly a copy&paste oversight from code in minivect. Can this function
>> (and the other changes in that file that came in the same commit) be
>> removed from the 0.18 branch or are they needed for something?
>>
>> https://github.com/cython/cython/commit/b9a2c953974c4ebc4aa37e7e64d642ce117337fb
>
> Those changes are needed to support specifying memoryviews from pure
> python. This is useful for instance to select a memoryview
> specialization of a def function from Python.
> 
> I think the fix is to just define that exception and remove the
> reference to minierror.

Ok, done.

https://github.com/cython/cython/commit/3bd0ad9379d9eb5597494dde9377fe5b5d9e89f3

Stefan

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


[Cython] 0.18 beta 1 released

2013-01-19 Thread Stefan Behnel
Hi,

here's the first (and hopefully last) beta of Cython 0.18. Please give it a
try. The final release is expected to follow soon.

http://cython.org/release/Cython-0.18b1.tar.gz

http://cython.org/release/Cython-0.18b1.zip


This is a feature release with the following changes:

* Named Unicode escapes ("\N{...}") are supported.

* Python functions/classes provide the special attribute "__qualname__"
  as defined by PEP 3155.

* Added a directive ``overflowcheck`` which raises an OverflowException
  when arithmetic with C ints overflows.  This has a modest performance
  penalty, but is much faster than using Python ints.

* Calls to nested Python functions are resolved at compile time.

* Type inference works across nested functions.

* ``py_bytes_string.decode(...)`` is optimised.

* C ``const`` declarations are supported in the language.


Have fun,

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


[Cython] namespacing external declarations (was: [cython-users] Calling C++ functions without headers.)

2013-01-19 Thread Stefan Behnel
John Tyree, 20.01.2013 04:11:
> On Fri, Jan 18, 2013 at 10:54:24AM -0800, Robert Bradshaw wrote:
>> On Fri, Jan 18, 2013 at 8:21 AM, John Tyree wrote:
>>> There's no way to have namespaces come over with the function names is 
>>> there?
>>>
>>> cdef extern from "b.cpp" namespace "foo":
>>> void whatever()
>>>
>>> and then use foo.whatever() instead of just whatever()? I guess using a new 
>>> pxd
>>> for each namespace and then cimport namespace is the best solution to that 
>>> problem.
>>
>> Yep. We could consider adding a "as XXX" clause to extern inport
>> blocks as well.
>
> The as XXX alias on cdef extern from ... blocks would be seriously great. 
> Would
> it be difficult?

I'm -0.7 on this. It would divert from Python in that you'd get yet another
way to provide a namespace inside of one source file. It won't come for
free in terms of compiler code complexity. And I don't see the big win over
having one .pxd file per namespace that you declare. That's what files are
there for, after all. And it works the same in both Python and Cython,
right now.

Stefan

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