1. ariovistus
  2. pyd


ariovistus  committed 3551f28

Edited online

  • Participants
  • Parent commits 21ad0e5
  • Branches default

Comments (0)

Files changed (1)

File FuncWrap.wiki

View file
  • Ignore whitespace
 * **modulename** is the name of the python module in which the wrapped function resides.
 * **fn** is the function to wrap. Note that this is an alias parameter. def is only capable of wrapping full-fledged functions, not function pointers, function literals, or delegates.
 * **name** is the name the function will have inside of Python. Usually, you don't have to specify this. (Special thanks to Don Clugston's Nameof module.)
-* **fn_t** is the function type of the function. Typically, you won't have to specify this. It is used to wrap overloaded functions. (See below.)
+* **fn_t** is a function type. If fn is overloaded, fn_t will need to be specified in order for pyd to select the correct overload.
 * **MIN_ARGS** is the minimum number of arguments this function can accept. It is used when a function has default arguments. The minArgs template can derive the correct number automatically, so you typically won't specify this manually.
-    docstring is the function's docstring. Note that this is a regular function argument!
+* **docstring** is the function's docstring. Note that this is a regular function argument!
 All calls to def must occur before calling module_init. Any function whose return type and arguments are convertible can be wrapped by def. def can only wrap functions with in arguments (not out or ref or lazy). def also provides support for wrapping overloaded functions as well as functions with default arguments. Here are some examples: