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
Boxiang Sun
cython
Commits
3ed359ce
Commit
3ed359ce
authored
Sep 19, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cython optimizations regarding embedding signatures
parent
e04c414e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
Cython/Compiler/AutoDocTransforms.py
Cython/Compiler/AutoDocTransforms.py
+13
-3
No files found.
Cython/Compiler/AutoDocTransforms.py
View file @
3ed359ce
...
@@ -89,6 +89,14 @@ class EmbedSignature(CythonTransform):
...
@@ -89,6 +89,14 @@ class EmbedSignature(CythonTransform):
else:
else:
return signature
return signature
def __call__(self, node):
if not Options.docstrings:
return node
else:
self.visitchildren(node)
return node
def visit_ClassDefNode(self, node):
def visit_ClassDefNode(self, node):
oldincls = self.is_in_class
oldincls = self.is_in_class
oldname = self.class_name
oldname = self.class_name
...
@@ -105,6 +113,9 @@ class EmbedSignature(CythonTransform):
...
@@ -105,6 +113,9 @@ class EmbedSignature(CythonTransform):
return node
return node
def visit_FuncDefNode(self, node):
def visit_FuncDefNode(self, node):
if not node.options['
embedsignature
']:
return node
signature = None
signature = None
if type(node) is DefNode: # def FOO(...):
if type(node) is DefNode: # def FOO(...):
special_method = (self.is_in_class and
\
special_method = (self.is_in_class and
\
...
@@ -126,7 +137,6 @@ class EmbedSignature(CythonTransform):
...
@@ -126,7 +137,6 @@ class EmbedSignature(CythonTransform):
else: # should not fall here ...
else: # should not fall here ...
assert False
assert False
if signature:
if signature:
if Options.docstrings and node.options['
embedsignature
']:
new_doc = self._embed_signature(signature, node.doc)
new_doc = self._embed_signature(signature, node.doc)
node.doc = EncodedString(new_doc) # XXX
node.doc = EncodedString(new_doc) # XXX
return node
return node
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