Is it allowed to use function results as default arguments ?
ggpolo at gmail.com
Tue Jul 29 00:38:24 CEST 2008
On Mon, Jul 28, 2008 at 5:28 PM, Stef Mientki <stef.mientki at gmail.com> wrote:
> 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 ) :
> As inspect returns the following:
> (['target', 'base'], None, None, ('.',))
Are you referring to the last item in the tuple above ? It is merely
listing the default values, it is not associating target to '.'. What
else would the tuple be if there is just base with a default value ?
> Stef Mientki
-- Guilherme H. Polo Goncalves
More information about the Python-list