projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b5860e7
)
reduce code-gen time spent in builtins
author
Stefan Behnel
<scoder@users.berlios.de>
Fri, 3 Jul 2009 20:20:16 +0000
(22:20 +0200)
committer
Stefan Behnel
<scoder@users.berlios.de>
Fri, 3 Jul 2009 20:20:16 +0000
(22:20 +0200)
Cython/Compiler/Code.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/Code.py
b/Cython/Compiler/Code.py
index a1dce43243016aaa0929693d0eac080cb7f1a3c5..81d8d96402ffc7ea36df054c245663924037c81c 100644
(file)
--- a/
Cython/Compiler/Code.py
+++ b/
Cython/Compiler/Code.py
@@
-723,8
+723,15
@@
class GlobalState(object):
def funccontext_property(name):
+ try:
+ import operator
+ attribute_of = operator.attrgetter(name)
+ except:
+ def attribute_of(o):
+ return getattr(o, name)
+
def get(self):
- return
getattr(self.funcstate, nam
e)
+ return
attribute_of(self.funcstat
e)
def set(self, value):
setattr(self.funcstate, name, value)
return property(get, set)