Re: [Cython] Template functions

2013-03-18 Thread Robert Bradshaw
On Sun, Mar 17, 2013 at 12:15 PM, John Tyree wrote: >> >> I was thinking of something along the lines of >> >> cdef extern from ...: >> cpp_string to_string[T](T value) >> T my_func[T, S](T a, S b) >> ... >> >> It's more a question of how to implement it. >> >> - Robert > > Well this c

[Cython] Minor bun in compile time constant handling

2013-03-18 Thread Nikita Nemkin
Hi, Here: https://github.com/cython/cython/blob/master/Cython/Compiler/Parsing.py#L708-L711 compile-time unicode and bytes values should be wrapped with EncodedString and BytesLiteral respectively: elif isinstance(value, _unicode): return ExprNodes.UnicodeNode(pos, value=EncodedStrin