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
b64eafe7
Commit
b64eafe7
authored
Nov 18, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the PyOS_*() string comparison/conversion functions as cpython/conversion.pxd.
parent
5db55d5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
Cython/Includes/cpython/conversion.pxd
Cython/Includes/cpython/conversion.pxd
+31
-0
tests/run/cython_includes.pyx
tests/run/cython_includes.pyx
+1
-0
No files found.
Cython/Includes/cpython/conversion.pxd
0 → 100644
View file @
b64eafe7
# From https://docs.python.org/3/c-api/conversion.html
from
.object
cimport
PyObject
cdef
extern
from
"Python.h"
:
ctypedef
struct
va_list
int
PyOS_snprintf
(
char
*
str
,
size_t
size
,
const
char
*
format
,
...)
# Output not more than size bytes to str according to the format
# string format and the extra arguments. See the Unix man page snprintf(2).
int
PyOS_vsnprintf
(
char
*
str
,
size_t
size
,
const
char
*
format
,
va_list
va
)
# Output not more than size bytes to str according to the format
# string format and the variable argument list va. Unix man page vsnprintf(2).
double
PyOS_string_to_double
(
const
char
*
s
,
char
**
endptr
,
PyObject
*
overflow_exception
)
# Convert a string s to a double, raising a Python exception on failure. The set of
# accepted strings corresponds to the set of strings accepted by Python’s float()
# constructor, except that s must not have leading or trailing whitespace.
# The conversion is independent of the current locale.
char
*
PyOS_double_to_string
(
double
val
,
char
format_code
,
int
precision
,
int
flags
,
int
*
ptype
)
# Convert a double val to a string using supplied format_code, precision, and flags.
int
PyOS_stricmp
(
const
char
*
s1
,
const
char
*
s2
)
# Case insensitive comparison of strings. The function works almost identically
# to strcmp() except that it ignores the case.
int
PyOS_strnicmp
(
const
char
*
s1
,
const
char
*
s2
,
Py_ssize_t
size
)
# Case insensitive comparison of strings. The function works almost identically
# to strncmp() except that it ignores the case.
tests/run/cython_includes.pyx
View file @
b64eafe7
...
@@ -15,6 +15,7 @@ cimport cpython.ceval
...
@@ -15,6 +15,7 @@ cimport cpython.ceval
cimport
cpython.cobject
cimport
cpython.cobject
cimport
cpython.codecs
cimport
cpython.codecs
cimport
cpython.complex
cimport
cpython.complex
cimport
cpython.conversion
cimport
cpython.datetime
cimport
cpython.datetime
cimport
cpython.dict
cimport
cpython.dict
cimport
cpython.exc
cimport
cpython.exc
...
...
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