Usages of defaultParameters and parameterNames

Andreas Pakulat apaku at gmx.de
Sun Feb 24 13:25:18 UTC 2008


On 24.02.08 13:58:42, Andreas Pakulat wrote:
> Hi,
> 
> how are the above functions from AbstractFunctionDeclaration used in
> C++? According to the docs defaultParameters may be a problem for
> python, because a python function can have:
> 
> def foo(bar=1,*foo,**baz)
> 
> i.e. the last defaultParameter is not necessarily the last paramter. I'm
> thinking we might need to introduce a proper list of structures there,
> something very simple with just a name an optional a value.

Actually, I've got even worse problems. I can't really fill these except
for the simplest case of a parameter name. But in python I can also have
a list of parameter names (like def foo( (bar,baz,foo) ) as 1 argument.
Where of course each name is a separate variable inside the function,
but you can only call that function either as 

foo() or foo([1,5,2]) (or anything else in the list). And I can access
the 3 elements with the names.

So I'm thinking about simply not filling these, if they're not that
important.

Also something similar exists for the default values, that can be any
arbitrary expression.

Andreas

-- 
Stay away from flying saucers today.




More information about the KDevelop-devel mailing list