Re: Is it allowed to use function results as default arguments ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guilherme Polo

    Re: Is it allowed to use function results as default arguments ?

    On Mon, Jul 28, 2008 at 5:28 PM, Stef Mientki <stef.mientki@g mail.comwrote:
    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_Pa th ( 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 ?


    --
    -- Guilherme H. Polo Goncalves
Working...