Re: [Cython] Possible bug when using cython -Wextra

2013-02-14 Thread mark florisson
On 14 February 2013 05:08, Robert Bradshaw  wrote:
> On Thu, Feb 7, 2013 at 10:05 AM, Stefan Behnel  wrote:
>> Samuele Kaplun, 07.02.2013 13:00:
>>> In data giovedì 7 febbraio 2013 12:11:47, Stefan Behnel ha scritto:
> [...]
>
> def test():
> cdef int i
>
> for i from 0 <= i < 10:
> print "foo"
>
> [...]

 Yes, it actually is an unused variable in your code. There is no reference
 to it, only assignments.
>>>
>>> mmh. But is it used albeit indirectly. Then what pattern would you suggest 
>>> in
>>> this case (i.e. to repeat a certain body a given number of times), in order 
>>> to
>>> avoid such warning?
>>
>> The normal thing to do in Python would be to use an underscore (i.e. "_")
>> as variable name. I don't think we currently special case that pattern,
>> though. Maybe we should.
>
> I agree. Done.
>
>> Or maybe we should just drop the "unused variable" warning for loop
>> variables as they actually do something and serve a purpose, even if they
>> are never referenced.
>
> +1 to this too. (Not yet done.)

Yeah, I think that's the sanest thing. I already implemented this in
Numba which bases its control flow on Cython's (because it's awesome,
thanks to Vitja :)). It simply adds a flag to NameAssignment which is
set for the ForNode's target variable.

> - Robert
> ___
> 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


[Cython] Fwd: A new webpage promoting Compiler technology for CPython

2013-02-14 Thread Stefan Behnel
This just came through python-dev:

 Original-Message 
Subject: A new webpage promoting Compiler technology for CPython
Date: Fri, 15 Feb 2013 01:11:12 -0600
From: Travis Oliphant 

Hey all,

With Numba and Blaze we have been doing a lot of work on what essentially
is compiler technology and realizing more and more that we are treading on
ground that has been plowed before with many other projects.   So, we
wanted to create a web-site and perhaps even a mailing list or forum where
people could coordinate and communicate about compiler projects, compiler
tools, and ways to share efforts and ideas.

The website is:  http://compilers.pydata.org/

This page is specifically for Compiler projects that either integrate with
or work directly with the CPython run-time which is why PyPy is not
presently listed.  The PyPy project is a great project but we just felt
that we wanted to explicitly create a collection of links to compilation
projects that are accessible from CPython which are likely less well known.

But that is just where we started from.   The website is intended to be a
community website constructed from a github repository.   So, we welcome
pull requests from anyone who would like to see the website updated to
reflect their related project.Jon Riehl (Mython, PyFront, ROFL, and
many other interesting projects) and Stephen Diehl (Blaze) and I will be
moderating the pull requests to begin with.   But, we welcome others with
similar interests to participate in that effort of moderation.

The github repository is here:  https://github.com/pydata/compilers-webpage

This is intended to be a community website for information spreading, and
so we welcome any and all contributions.

Thank you,

Travis Oliphant

___
NumPy-Discussion mailing list
numpy-discuss...@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

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