Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
27cb4ad5
Commit
27cb4ad5
authored
Sep 22, 2011
by
Mark Florisson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:cython/cython
parents
b4f0ba7c
06bb6a93
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
5 deletions
+20
-5
Cython/Build/Dependencies.py
Cython/Build/Dependencies.py
+13
-0
Cython/Build/Inline.py
Cython/Build/Inline.py
+2
-1
Cython/Compiler/Main.py
Cython/Compiler/Main.py
+4
-3
Cython/__init__.py
Cython/__init__.py
+1
-1
No files found.
Cython/Build/Dependencies.py
View file @
27cb4ad5
...
...
@@ -7,6 +7,19 @@ from distutils.extension import Extension
from
Cython
import
Utils
from
Cython.Compiler.Main
import
Context
,
CompilationOptions
,
default_options
def
cached_function
(
f
):
cache_name
=
'__%s_cache'
%
f
.
__name__
def
wrapper
(
*
args
):
cache
=
getattr
(
f
,
cache_name
,
None
)
if
cache
is
None
:
cache
=
{}
setattr
(
f
,
cache_name
,
cache
)
if
args
in
cache
:
return
cache
[
args
]
res
=
cache
[
args
]
=
f
(
*
args
)
return
res
return
wrapper
def
cached_method
(
f
):
cache_name
=
'__%s_cache'
%
f
.
__name__
def
wrapper
(
self
,
*
args
):
...
...
Cython/Build/Inline.py
View file @
27cb4ad5
...
...
@@ -14,7 +14,7 @@ from Cython.Compiler.Main import Context, CompilationOptions, default_options
from
Cython.Compiler.ParseTreeTransforms
import
CythonTransform
,
SkipDeclarations
,
AnalyseDeclarationsTransform
from
Cython.Compiler.TreeFragment
import
parse_from_strings
from
Cython.Build.Dependencies
import
strip_string_literals
,
cythonize
from
Cython.Build.Dependencies
import
strip_string_literals
,
cythonize
,
cached_function
from
Cython.Compiler
import
Pipeline
import
cython
as
cython_module
...
...
@@ -38,6 +38,7 @@ class AllSymbols(CythonTransform, SkipDeclarations):
def
visit_NameNode
(
self
,
node
):
self
.
names
.
add
(
node
.
name
)
@
cached_function
def
unbound_symbols
(
code
,
context
=
None
):
code
=
to_unicode
(
code
)
if
context
is
None
:
...
...
Cython/Compiler/Main.py
View file @
27cb4ad5
...
...
@@ -65,9 +65,10 @@ class Context(object):
import
Builtin
,
CythonScope
self
.
modules
=
{
"__builtin__"
:
Builtin
.
builtin_scope
}
cyscope
=
CythonScope
.
create_cython_scope
(
if
self
.
cython_scope
is
None
:
Context
.
cython_scope
=
CythonScope
.
create_cython_scope
(
self
,
create_testscope
=
create_testscope
)
self
.
modules
[
"cython"
]
=
self
.
cython_scope
=
cyscope
self
.
modules
[
"cython"
]
=
self
.
cython_scope
self
.
include_directories
=
include_directories
self
.
future_directives
=
set
()
self
.
compiler_directives
=
compiler_directives
...
...
Cython/__init__.py
View file @
27cb4ad5
__version__
=
"0.15+"
__version__
=
"0.15
.1
+"
# Void cython.* directives (for case insensitive operating systems).
from
Cython.Shadow
import
*
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment