Functions attributes accessed from within the function definition URGENT please

dsavitsk dsavitsk at e-coli.net
Wed May 30 10:20:37 EDT 2001


is this what you are after?

def f(x=31426):
    pass


"Fernando Rodríguez" <spamers at must.die> wrote in message
news:o70aht0nl21e323pfkmgj0p6sabhm7q6f3 at 4ax.com...
> Hi!
>
> I have a function f that will have an attribute x: f.x = 31426 (for
> example).
>
> When defining the function f, I'd like to give this attribute a
> default value, so I'll never get an error when trying to access it with
f.x,
> how can I do this (setting the default value)? O:-)
>
> TIA
>
>
>
>
> 'Fernando





More information about the Python-list mailing list