Is it allowed to use function results as default arguments ?

Benjamin musiccomposition at gmail.com
Mon Jul 28 22:33:25 EDT 2008


On Jul 28, 3:28 pm, Stef Mientki <stef.mien... at gmail.com> wrote:
> hello,
>
> I've a perfect working procedure,
> at least as far I've tested it it works perfect.
>
> But I was just experimenting with inspect,
> and saw that the default argument was not parsed correctly.
>
> So I wonder if this is allowed:
>
> def Get_Relative_Path ( target, base=os.curdir ) :

Did you perhaps mean to say def Get_Relative_Path(target,
base=os.getcwd()):
>   ...
>
> As inspect returns the following:
>
> (['target', 'base'], None, None, ('.',))
>
> thanks,
> Stef Mientki




More information about the Python-list mailing list