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
Gwenaël Samain
cython
Commits
5905117e
Commit
5905117e
authored
Jun 26, 2011
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert typeof() strings back to "list object" etc
parent
305e355c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
9 deletions
+6
-9
Cython/Build/Tests/TestInline.py
Cython/Build/Tests/TestInline.py
+1
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+0
-3
tests/run/public_fused_types.srctree
tests/run/public_fused_types.srctree
+4
-4
No files found.
Cython/Build/Tests/TestInline.py
View file @
5905117e
...
...
@@ -30,7 +30,7 @@ class TestInline(CythonTest):
self
.
assertEquals
(
inline
(
"""
cimport cython
return cython.typeof(a), cython.typeof(b)
"""
,
a
=
1.0
,
b
=
[],
**
self
.
test_kwds
),
(
'double'
,
'list'
))
"""
,
a
=
1.0
,
b
=
[],
**
self
.
test_kwds
),
(
'double'
,
'list
object
'
))
def
test_locals
(
self
):
a
=
1
...
...
Cython/Compiler/ExprNodes.py
View file @
5905117e
...
...
@@ -6061,7 +6061,7 @@ class TypeofNode(ExprNode):
def
analyse_types
(
self
,
env
):
self
.
operand
.
analyse_types
(
env
)
value
=
StringEncoding
.
EncodedString
(
self
.
operand
.
type
.
typeof_name
())
value
=
StringEncoding
.
EncodedString
(
s
tr
(
self
.
operand
.
type
))
#s
elf.operand.type.typeof_name())
self
.
literal
=
StringNode
(
self
.
pos
,
value
=
value
)
self
.
literal
.
analyse_types
(
env
)
self
.
literal
=
self
.
literal
.
coerce_to_pyobject
(
env
)
...
...
Cython/Compiler/Nodes.py
View file @
5905117e
...
...
@@ -1042,9 +1042,6 @@ class CVarDefNode(StatNode):
else
:
if
self
.
directive_locals
:
error
(
self
.
pos
,
"Decorators can only be followed by functions"
)
if
self
.
in_pxd
and
self
.
visibility
!=
'extern'
:
error
(
self
.
pos
,
"Only 'extern' C variable declaration allowed in .pxd file"
)
self
.
entry
=
dest_scope
.
declare_var
(
name
,
type
,
declarator
.
pos
,
cname
=
cname
,
visibility
=
visibility
,
api
=
self
.
api
,
is_cdef
=
1
)
...
...
tests/run/public_fused_types.srctree
View file @
5905117e
...
...
@@ -174,16 +174,16 @@ def ae(result, expected):
assert result == expected
ae(a_mod.public_cpdef["int, float, list"](5, 6, [7]), ("int", "float", "list"))
ae(a_mod.public_cpdef[int, float, list](5, 6, [7]), ("int", "float", "list"))
ae(a_mod.public_cpdef["int, float, list"](5, 6, [7]), ("int", "float", "list
object
"))
ae(a_mod.public_cpdef[int, float, list](5, 6, [7]), ("int", "float", "list
object
"))
idx = cy.typeof(0), cy.typeof(0.0), cy.typeof([])
ae(a_mod.public_cpdef[idx](5, 6, [7]), ("int", "float", "list"))
ae(a_mod.public_cpdef[idx](5, 6, [7]), ("int", "float", "list
object
"))
ae(a_mod.public_cpdef[cy.int, cy.double, cython.typeof(obj)](5, 6, obj), ("int", "double", "TestFusedExtMethods"))
ae(a_mod.public_cpdef[cy.int, cy.double, cython.typeof(obj)](5, 6, myobj), ("int", "double", "TestFusedExtMethods"))
ae(public_cpdef[int, float, list](5, 6, [7]), ("int", "float", "list"))
ae(public_cpdef[int, float, list](5, 6, [7]), ("int", "float", "list
object
"))
ae(public_cpdef[int, double, TestFusedExtMethods](5, 6, obj), ("int", "double", "TestFusedExtMethods"))
ae(public_cpdef[int, double, TestFusedExtMethods](5, 6, myobj), ("int", "double", "TestFusedExtMethods"))
...
...
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