Sorry, sent the first copy only to Hugo.

> Any function that gets arrays on their arguments must be treated as special 
> cases, because there's no way to create a heuristic that will do the right 
> thing in all cases :-/
>
> What you really need to do to fix your function depends on the semantics of 
> your function and how you want to export it to Python.
>   

I understand the need and semantics for changing the handling of arrays
for function arguments. However, I am not trying to change the behavior
for a function argument in this case. I am trying to access a member (or
class static) variable that happens to be an array. The example I gave
is roughly as follows:

class Foo
{
public:
    // constructor, other methods, etc.
    size_t scalar;
    size_t array[2];
}

As you suggested, adding a primitive-type tag like this:

<primitive-type name="size_t" default-constructor="0"
target-lang-api-name="PyLong" />


works great for the member variable "scalar" above. It does not handle
the member variable "array" above. It really can just become either a
Python tuple or a list, with a slight preference for a tuple in the case
of a static const class variable that happens to be an array.

Have I missed something?

Thank you for your help
John Cummings
_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside

Reply via email to