Re: [Cython] How to define C-consts in python module scope

2011-07-18 Thread Vitja Makarov
2011/7/19 Robert Bradshaw : > On Mon, Jul 18, 2011 at 10:24 PM, Vitja Makarov > wrote: >> 2011/7/18 Robert Bradshaw : >>> Trevor King and I discussed this quite a while back, but every time I >>> got around to looking at his code (I don't think he ever created a >>> formal pull request) something

Re: [Cython] How to define C-consts in python module scope

2011-07-18 Thread Robert Bradshaw
On Mon, Jul 18, 2011 at 10:24 PM, Vitja Makarov wrote: > 2011/7/18 Robert Bradshaw : >> Trevor King and I discussed this quite a while back, but every time I >> got around to looking at his code (I don't think he ever created a >> formal pull request) something came up. The idea was that we could

Re: [Cython] How to define C-consts in python module scope

2011-07-18 Thread Vitja Makarov
2011/7/18 Robert Bradshaw : > Trevor King and I discussed this quite a while back, but every time I > got around to looking at his code (I don't think he ever created a > formal pull request) something came up. The idea was that we could > support cpdef structs and extern functions as well. > That

Re: [Cython] Any news from the IronPython port?

2011-07-18 Thread Robert Bradshaw
On Mon, Jul 18, 2011 at 7:45 AM, Jason McCampbell wrote: > Hi Stefan, > Definitely not buried for good, though we haven't made a lot of changes > recently. :)  We used it for porting SciPy to .NET and re-wrote a large > number of the SciPy C module implementations in Cython.  It is generally > sta

Re: [Cython] How to define C-consts in python module scope

2011-07-18 Thread Robert Bradshaw
On Mon, Jul 18, 2011 at 4:34 PM, Greg Ewing wrote: > Chris Colbert wrote: > >>    cdef public enum: >>       EV_READ  = 1 >>       EV_WRITE = 2 >> >>    However, I do not like it, because I would like to use "public" for >>    other meaning (API generation). > > My suggestion is > >  cdef exposed

Re: [Cython] How to define C-consts in python module scope

2011-07-18 Thread Greg Ewing
Chris Colbert wrote: cdef public enum: EV_READ = 1 EV_WRITE = 2 However, I do not like it, because I would like to use "public" for other meaning (API generation). My suggestion is cdef exposed enum: ... -- Greg __

Re: [Cython] How to define C-consts in python module scope

2011-07-18 Thread Robert Bradshaw
Trevor King and I discussed this quite a while back, but every time I got around to looking at his code (I don't think he ever created a formal pull request) something came up. The idea was that we could support cpdef structs and extern functions as well. On Mon, Jul 18, 2011 at 2:38 AM, Vitja Mak

Re: [Cython] How to define C-consts in python module scope

2011-07-18 Thread Vitja Makarov
2011/7/18 Chris Colbert : > > > On Mon, Jul 18, 2011 at 12:14 PM, Lisandro Dalcin wrote: >> >> On 18 July 2011 06:38, Vitja Makarov wrote: >> > cdef enum: >> >     EV_READ  = 1 >> >     EV_WRITE = 2 >> > >> > Is there a way to put this constants into module dict? >> > I want to access this consta

Re: [Cython] How to define C-consts in python module scope

2011-07-18 Thread Vitja Makarov
2011/7/18 Lisandro Dalcin : > On 18 July 2011 06:38, Vitja Makarov wrote: >> cdef enum: >>     EV_READ  = 1 >>     EV_WRITE = 2 >> >> Is there a way to put this constants into module dict? >> I want to access this constants from pure python code, I tried this way: >> >> globals()['EV_READ'] = EV_R

Re: [Cython] How to define C-consts in python module scope

2011-07-18 Thread Chris Colbert
On Mon, Jul 18, 2011 at 12:14 PM, Lisandro Dalcin wrote: > On 18 July 2011 06:38, Vitja Makarov wrote: > > cdef enum: > > EV_READ = 1 > > EV_WRITE = 2 > > > > Is there a way to put this constants into module dict? > > I want to access this constants from pure python code, I tried this w

Re: [Cython] How to define C-consts in python module scope

2011-07-18 Thread Lisandro Dalcin
On 18 July 2011 06:38, Vitja Makarov wrote: > cdef enum: >     EV_READ  = 1 >     EV_WRITE = 2 > > Is there a way to put this constants into module dict? > I want to access this constants from pure python code, I tried this way: > > globals()['EV_READ'] = EV_READ > globals()['EV_WRITE'] = EV_WRITE

Re: [Cython] Any news from the IronPython port?

2011-07-18 Thread Matthew Brett
Hi, On Mon, Jul 18, 2011 at 3:45 PM, Jason McCampbell wrote: > Hi Stefan, > Definitely not buried for good, though we haven't made a lot of changes > recently. :)  We used it for porting SciPy to .NET and re-wrote a large > number of the SciPy C module implementations in Cython. That sounds very

Re: [Cython] Any news from the IronPython port?

2011-07-18 Thread Jason McCampbell
Hi Stefan, Definitely not buried for good, though we haven't made a lot of changes recently. :) We used it for porting SciPy to .NET and re-wrote a large number of the SciPy C module implementations in Cython. It is generally stable and produces good code within the set of features that were nee

[Cython] How to define C-consts in python module scope

2011-07-18 Thread Vitja Makarov
cdef enum: EV_READ = 1 EV_WRITE = 2 Is there a way to put this constants into module dict? I want to access this constants from pure python code, I tried this way: globals()['EV_READ'] = EV_READ globals()['EV_WRITE'] = EV_WRITE But I don't like it, is there any other way? -- vitja.