See the %MethodCode directive for more detail. Pointer to the Python object that wraps the argument. It causes anĮxtra variable to be generated for the corresponding argument which is a This boolean annotation is only ever used in conjunction with handwrittenĬode specified with the %MethodCode directive. Python v2 will use the str type to represent the argument if theĮncoding is "None" and the unicode type otherwise. Python v3 will use the bytes type to represent the argument if theĮncoding is "None" and the str type otherwise. If the directive is not specified then None is used. The default encoding is specified by the %DefaultEncodingĭirective. That the corresponding argument refers to an unencoded character or string. Refers to an encoded character or '\0' terminated encoded string with Should be either char, const char, char * or const char *) This string annotation specifies that the corresponding argument (which This string annotation specifies the default value of the argument as it For example:ĭeprecated since version 4.18: Use the TypeHintValue annotation instead. When wrapping C or C++ functions with similar signatures. Then the integer will be converted appropriately. ForĮxample, if a floating pointer number is expected and an integer supplied, Python will automatically convert between certain compatible types. The annotation may only be specified once in a list of arguments. There mustīe a corresponding argument with the Array annotation specified. Long or unsigned long) refers to the size of an array. Should be either short, unsigned short, int, unsigned, This boolean annotation specifies that the corresponding argument (which The annotation may only be specified once in a list There must be a corresponding argument with the ArraySizeĪnnotation specified. If the argument is a character array then theĪnnotation also implies the Encoding annotation with an encoding The argument should be either a pointer to a wrapped type, a char * orĪ unsigned char *. This boolean annotation specifies that the corresponding argument refers SIP_PYSLICE, SIP_PYTUPLE or SIP_PYTYPE) may be This boolean annotation specifies that the value of the correspondingĪrgument (which should be either SIP_PYBUFFER, Each bound can be omitted meaning that the range is Within the range if it is greater or equal to the lower bound and less Specifying the lower and upper bounds of the range. The range of version numbers is a pair of numbers separated by a hyphen The value is the name of an API (defined using the %APIĭirective) separated by a range of version numbers with a colon. string The value is a double quoted string. dotted name The value is a name that is compatible with an identifier preceded by a name The value is a name that is compatible with a C/C++ identifier. integer This type of annotation is an integer. The name of an annotation and its value are separated byĪnnotations can have one of the following types: boolean This type of annotation has no value and is implicitly true. The type determines theįormat of the value. Multiple annotationsĪnnotations have a type and, possibly, a value. Variable annotations depending on the context inĪnnotations are placed between forward slashes ( /). In this section we describe each of the annotations that can be used inĪnnotations can either be argument annotations,Ĭlass annotations, mapped type annotations, enum annotations,Įxception annotations, function annotations, typedef annotations or
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |