On Fri, Dec 12, 2008 at 6:06 PM, Shrutarshi Basu
wrote:
> Is there a way to ask an object for a list of it's
> methods (with argument requirements if possible)?
Take a look at the inspect module. If it does not directly give you
what you need, look at the source - it looks at function attributes
On Sat, 13 Dec 2008 10:19:34 +0100, Andreas Kostyrka wrote:
> On Sat, Dec 13, 2008 at 08:03:10AM +, Lie Ryan wrote:
>> On Sat, 13 Dec 2008 02:59:34 +0100, Andreas Kostyrka wrote:
>>
>> > On Fri, Dec 12, 2008 at 06:06:35PM -0500, Shrutarshi Basu wrote:
>> >> I have a list containing strings li
On Sat, Dec 13, 2008 at 08:03:10AM +, Lie Ryan wrote:
> On Sat, 13 Dec 2008 02:59:34 +0100, Andreas Kostyrka wrote:
>
> > On Fri, Dec 12, 2008 at 06:06:35PM -0500, Shrutarshi Basu wrote:
> >> I have a list containing strings like :
> >>
> >> func1[]
> >> func2[1,2]
> >> func3[blah]
> >>
> >>
On Sat, 13 Dec 2008 02:59:34 +0100, Andreas Kostyrka wrote:
> On Fri, Dec 12, 2008 at 06:06:35PM -0500, Shrutarshi Basu wrote:
>> I have a list containing strings like :
>>
>> func1[]
>> func2[1,2]
>> func3[blah]
>>
>> I want to turn them into method calls (with numeric or string
>> arguments) o
On Fri, Dec 12, 2008 at 06:06:35PM -0500, Shrutarshi Basu wrote:
> I have a list containing strings like :
>
> func1[]
> func2[1,2]
> func3[blah]
>
> I want to turn them into method calls (with numeric or string
> arguments) on a supplied object. I'm trying to figure out the best way
> to do this
On Fri, 12 Dec 2008 20:05:23 -0500, Shrutarshi Basu wrote:
> I normally would use exceptions, because I think exceptions are a great
> idea. But since the functions may be time-consuming graphics functions
> and the lists could easily be hundreds of such calls, I don't want the
> user to sit aroun
I normally would use exceptions, because I think exceptions are a
great idea. But since the functions may be time-consuming graphics
functions and the lists could easily be hundreds of such calls, I
don't want the user to sit around for something that might fail. Of
course, I'm just starting so my
"Shrutarshi Basu" wrote
I have a list containing strings like :
func1[]
func2[1,2]
func3[blah]
I want to turn them into method calls (with numeric or string
arguments) on a supplied object.
The easiest way is to call getattr() which will return a reference
to the method if it exists.
be r
I have a list containing strings like :
func1[]
func2[1,2]
func3[blah]
I want to turn them into method calls (with numeric or string
arguments) on a supplied object. I'm trying to figure out the best way
to do this. Since these lists could be very big, and the methods could
be rather complex (mai