
Sync, Async, Task
This could also be my version if you explicitly named the parameters and did: f.read( type=sync, len=len, buffer=buffer)
Ah, I see - sorry, wasn't aware of the explicit parameter naming thing in python. Cute :-)
I don't know if cute is the right word for it. Before you know it, someone will never forgive you for calling a language feature cute :P
And there are more... All options have pro and cons. We had that discussion for a long time as we designed the task model. If you are interested in gazillions of mails running circles, I can dig them out of the archive ;-)
I read it and it's indeed an 'interesting' (and long) discussion. I am not planning for another round of the same discussion, but the C++ solution is not usable in Python. Your final summary of the problem (found at http://wiki.cct.lsu.edu/saga/space/Task+Models ) states four solutions. Templates (c) and internal task factories (b) are not usable. a and d are really about adding a little 'thing' to to distinguish between doing a sync or getting a async or task. The same can be accomplished with a flag which is defaults type to 'sync'. It actually doesn't matter which solution is chosen. More keystrokes are always needed. Wait, I am adding another round to discussion. :/
No idea if python provides some clever way to solve this - most other languages don't. Thus, please do also consider to put the flag in the first place, or to use some other qualifiers (method name, etc). Can't recall at the moment what way Hartmut chose in his Python implementation, sorry.
If it is an optional parameter with a default specified, it has to go in the back of the parameter list. I don't know if this clarifies some issues for you?
Yes, it does, thanks.
I think I also saw somthing resembling a flag in Hartmuts Python wrapper apidoc, although I can't find it anymore. ('service' parameter?) Anyway, happy left-handers day (aug 13th) everyone! Paul.