char_constants_T99.pyx 327 Bytes
Newer Older
Stefan Behnel's avatar
Stefan Behnel committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
__doc__ = u"""
>>> global_c_and_s()
99
abcdef

>>> local_c_and_s()
98
bcdefg
"""

cdef char c = 'c'
cdef char* s = 'abcdef'

def global_c_and_s():
    pys = s
    print c
    print pys.decode('ASCII')

def local_c_and_s():
    cdef char c = 'b'
    cdef char* s = 'bcdefg'
    pys = s
    print c
    print pys.decode('ASCII')