From ebfddaba04708a740523491095a5825cd8e0957b Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Mon, 12 Aug 2013 21:03:05 -0700 Subject: [PATCH] Clarify cdef vs. def function arguments. --- docs/src/userguide/language_basics.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/src/userguide/language_basics.rst b/docs/src/userguide/language_basics.rst index dd2308d..7c41c39 100644 --- a/docs/src/userguide/language_basics.rst +++ b/docs/src/userguide/language_basics.rst @@ -117,7 +117,14 @@ using normal C declaration syntax. For example,:: When a parameter of a Python function is declared to have a C data type, it is passed in as a Python object and automatically converted to a C value, if -possible. Automatic conversion is currently only possible for numeric types, +possible. In other words, the definition of `spam` above is equivalent to writing:: + + def spam(python_i, python_s): + int i = python_i + char* s = python_s + ... + +Automatic conversion is currently only possible for numeric types, string types and structs (composed recusively of any of these types); attempting to use any other type for the parameter of a Python function will result in a compile-time error. -- 2.7.4