Re: Access function defaults

2005-02-15 Thread Fredrik Lundh
James Stroud wrote: > By the way, I already know a million "better" ways to do this, so no > need for the "why would you want to do that?" responses. why not? (if you really want to know how this works, study the source code for the "getargspec" function in the inspect module. or easier, you ca

Access function defaults

2005-02-15 Thread James Stroud
Hello all, I'm curious--How do I access a function defaults by name? for example def bob(wife, wives=[]):   # add wife to wives if applicable   if (can_add_wife(wife,wives)):     wives.append(wife)   return len(wives) Say the bob function is adding to wives. What if you want to see what th