Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > howto check is object a func, lambda-func or something else?

Reply
Thread Tools

howto check is object a func, lambda-func or something else?

 
 
dmitrey
Guest
Posts: n/a
 
      04-29-2007
hi all,
howto check is object Arg1
- a func, lambda-func
- something else?

I tried callable(Arg1), but callable(lambda-func) returnes False

Thx, D.

 
Reply With Quote
 
 
 
 
Gregor Horvath
Guest
Posts: n/a
 
      04-29-2007
dmitrey schrieb:

> howto check is object Arg1
> - a func, lambda-func
> - something else?
>
> I tried callable(Arg1), but callable(lambda-func) returnes False


I don't understand your problem:

>>> callable(lambda:0)

True


Please post your relevant code.

Greg
 
Reply With Quote
 
 
 
 
7stud
Guest
Posts: n/a
 
      04-29-2007
On Apr 29, 11:19 am, dmitrey <(E-Mail Removed)> wrote:
>
> callable(lambda-func) returnes False
>


I'm not seeing that. Try this:

f = lambda x: x
print callable(f)

---output:--
True

 
Reply With Quote
 
dmitrey
Guest
Posts: n/a
 
      04-29-2007
Thank you, I have fixed the bug

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XPath query for <?define something="something" ?> Pekka Järvinen XML 2 04-29-2008 08:12 PM
object = watch(object){|x| "DO SOMETHING WITH X"} Erik Veenstra Ruby 0 01-27-2006 02:09 PM
Object creation - Do we really need to create a parent for a derieved object - can't the base object just point to an already created base object jon wayne C++ 9 09-22-2005 02:06 AM
howto make something like Errno::##, for my C ext, or do I need to? Sam Roberts Ruby 1 05-18-2005 06:17 PM
umm... something... template(s)... something else... pointer(s)... and such... 0.o yah, I'm hopeless and clueless o.0 C++ 4 10-13-2004 10:34 PM



Advertisments