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

2011-07-20 Thread Lisandro Dalcin
On 20 July 2011 23:41, Stefan Behnel wrote: > Hi, > > I think we're getting way off course with this discussion. The following is > a good way to get back into a useful direction. > > Robert Bradshaw, 20.07.2011 23:24: >> >> it would be a runtime error when trying to import the >> objects. I suppo

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

2011-07-20 Thread Stefan Behnel
Hi, I think we're getting way off course with this discussion. The following is a good way to get back into a useful direction. Robert Bradshaw, 20.07.2011 23:24: it would be a runtime error when trying to import the objects. I suppose if cimport does not inject anything into the python names

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

2011-07-20 Thread Robert Bradshaw
On Wed, Jul 20, 2011 at 2:53 PM, mark florisson wrote: > On 20 July 2011 23:24, Robert Bradshaw wrote: >> On Wed, Jul 20, 2011 at 12:53 PM, mark florisson >> wrote: >>> On 20 July 2011 21:44, Lisandro Dalcin wrote: On 20 July 2011 16:27, mark florisson wrote: > On 20 July 2011 21:13,

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

2011-07-20 Thread mark florisson
On 20 July 2011 23:24, Robert Bradshaw wrote: > On Wed, Jul 20, 2011 at 12:53 PM, mark florisson > wrote: >> On 20 July 2011 21:44, Lisandro Dalcin wrote: >>> On 20 July 2011 16:27, mark florisson wrote: On 20 July 2011 21:13, Lisandro Dalcin wrote: > On 20 July 2011 15:32, mark flori

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

2011-07-20 Thread Robert Bradshaw
On Wed, Jul 20, 2011 at 12:53 PM, mark florisson wrote: > On 20 July 2011 21:44, Lisandro Dalcin wrote: >> On 20 July 2011 16:27, mark florisson wrote: >>> On 20 July 2011 21:13, Lisandro Dalcin wrote: On 20 July 2011 15:32, mark florisson wrote: > On 20 July 2011 20:04, Lisandro Dalc

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

2011-07-20 Thread mark florisson
On 20 July 2011 21:44, Lisandro Dalcin wrote: > On 20 July 2011 16:27, mark florisson wrote: >> On 20 July 2011 21:13, Lisandro Dalcin wrote: >>> On 20 July 2011 15:32, mark florisson wrote: On 20 July 2011 20:04, Lisandro Dalcin wrote: > On 20 July 2011 13:51, mark florisson wrote:

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

2011-07-20 Thread Lisandro Dalcin
On 20 July 2011 16:27, mark florisson wrote: > On 20 July 2011 21:13, Lisandro Dalcin wrote: >> On 20 July 2011 15:32, mark florisson wrote: >>> On 20 July 2011 20:04, Lisandro Dalcin wrote: On 20 July 2011 13:51, mark florisson wrote: > On 20 July 2011 18:06, Lisandro Dalcin wrote:

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

2011-07-20 Thread mark florisson
On 20 July 2011 21:13, Lisandro Dalcin wrote: > On 20 July 2011 15:32, mark florisson wrote: >> On 20 July 2011 20:04, Lisandro Dalcin wrote: >>> On 20 July 2011 13:51, mark florisson wrote: On 20 July 2011 18:06, Lisandro Dalcin wrote: > On 19 July 2011 20:48, Robert Bradshaw >

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

2011-07-20 Thread Lisandro Dalcin
On 20 July 2011 15:32, mark florisson wrote: > On 20 July 2011 20:04, Lisandro Dalcin wrote: >> On 20 July 2011 13:51, mark florisson wrote: >>> On 20 July 2011 18:06, Lisandro Dalcin wrote: On 19 July 2011 20:48, Robert Bradshaw wrote: > On Tue, Jul 19, 2011 at 3:02 PM, Lisandr

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

2011-07-20 Thread mark florisson
On 20 July 2011 20:04, Lisandro Dalcin wrote: > On 20 July 2011 13:51, mark florisson wrote: >> On 20 July 2011 18:06, Lisandro Dalcin wrote: >>> On 19 July 2011 20:48, Robert Bradshaw wrote: On Tue, Jul 19, 2011 at 3:02 PM, Lisandro Dalcin wrote: > On 19 July 2011 02:24, Vitja Makaro

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

2011-07-20 Thread Lisandro Dalcin
On 20 July 2011 13:51, mark florisson wrote: > On 20 July 2011 18:06, Lisandro Dalcin wrote: >> On 19 July 2011 20:48, Robert Bradshaw wrote: >>> On Tue, Jul 19, 2011 at 3:02 PM, Lisandro Dalcin wrote: On 19 July 2011 02:24, Vitja Makarov wrote: > 2011/7/18 Robert Bradshaw : >> Tr

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

2011-07-20 Thread mark florisson
On 20 July 2011 18:06, Lisandro Dalcin wrote: > On 19 July 2011 20:48, Robert Bradshaw wrote: >> On Tue, Jul 19, 2011 at 3:02 PM, Lisandro Dalcin wrote: >>> On 19 July 2011 02:24, Vitja Makarov wrote: 2011/7/18 Robert Bradshaw : > Trevor King and I discussed this quite a while back, bu

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

2011-07-20 Thread Lisandro Dalcin
On 19 July 2011 20:48, Robert Bradshaw wrote: > On Tue, Jul 19, 2011 at 3:02 PM, Lisandro Dalcin wrote: >> On 19 July 2011 02:24, 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

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

2011-07-19 Thread Robert Bradshaw
On Tue, Jul 19, 2011 at 3:02 PM, Lisandro Dalcin wrote: > On 19 July 2011 02:24, 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 req

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

2011-07-19 Thread Vitja Makarov
2011/7/20 Lisandro Dalcin : > On 19 July 2011 02:24, 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

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

2011-07-19 Thread Lisandro Dalcin
On 19 July 2011 02:24, 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 >> support

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] 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