File: codefile

package info (click to toggle)
cython 0.15.1-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 16,480 kB
  • sloc: python: 45,354; xml: 1,031; cpp: 635; makefile: 229; lisp: 48; ansic: 28
file content (50 lines) | stat: -rw-r--r-- 645 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
cdef extern from "stdio.h":
    int puts(char *s)

cdef extern:
    void some_c_function()

import os

cdef int c_var = 12
python_var = 13

def spam(a=0):
    cdef:
        int b, c
    
    b = c = d = 0
    
    b = 1
    c = 2
    int(10)
    puts("spam")
    os.path.join("foo", "bar")
    some_c_function()

cpdef eggs():
    pass    
    
cdef ham():
    pass
    
cdef class SomeClass(object):
    def spam(self):
        pass

def outer():
    cdef object a = "an object"
    def inner():
        b = 2
        # access closed over variables
        print a, b
    return inner


outer()()

spam()
print "bye!"

def use_ham():
    ham()