I think we discuss enough this point and there is no sense to continue. I am
happy with the way I do it, but it seems that I have no other choice.
Problem: how user should address\refer to function argument and return
Current implementation: index is 1 based, in order to allow user to specify
1. Index should be 0 based.
2. Special const will be introduced to represent "reference" to return
return_ = None ( or -1 ).
3. function_transformation_t will have new variable - USE_1_BASED_INDEXING
By default its value will be False. Every one who consider "more
natural" to use
0 based indexing will set this to True.
4. function_transformation_t will introduce 2 new methods:
def get_argument( reference, func ):
if isinstance( reference, str ):
found = filter( lambda arg: arg.name == reference,
if len( found ) == 1:
raise RuntimeError( "Argument with %s was not found" % reference
assert isinstance( reference, int )
reference += 1
return func.arguments[ reference ]
def get_type( reference, func ):
if isinstance( reference, int ) and reference == return_:
return get_argument( reference, func ).type
As you can see new implementation allows to use argument names as
5. Every built-in transformer will have to use these functions.
One more time, I prefer to make a decision, when there is a consensus.
This time we don't have it. I hope the solution provides a compromise.
We still may discuss any detail of the solution, but I would like to make it
by default indexing will be 0 ( zero ) base.
C++ Python language binding