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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
113edaab
Commit
113edaab
authored
Aug 23, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement len(unicode) for PEP 393
--HG-- extra : rebase_source : 211fa0c1058750151e3524d4ca5854a86ed5289f
parent
7c01e848
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+7
-0
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+1
-1
No files found.
Cython/Compiler/ModuleNode.py
View file @
113edaab
...
...
@@ -578,6 +578,13 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
/* new Py3.3 unicode representation (PEP 393) */
#ifdef PyUnicode_GET_LENGTH
#define __Pyx_PyUnicode_GET_LENGTH PyUnicode_GET_LENGTH
#else
#define __Pyx_PyUnicode_GET_LENGTH PyUnicode_GET_SIZE
#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
...
...
Cython/Compiler/Optimize.py
View file @
113edaab
...
...
@@ -2037,7 +2037,7 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
])
_map_to_capi_len_function
=
{
Builtin
.
unicode_type
:
"
PyUnicode_GET_SIZE
"
,
Builtin
.
unicode_type
:
"
__Pyx_PyUnicode_GET_LENGTH
"
,
Builtin
.
bytes_type
:
"PyBytes_GET_SIZE"
,
Builtin
.
list_type
:
"PyList_GET_SIZE"
,
Builtin
.
tuple_type
:
"PyTuple_GET_SIZE"
,
...
...
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