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

Discussion in 'Python' started by dmitrey, Apr 29, 2007.

  1. dmitrey

    dmitrey Guest

    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.
     
    dmitrey, Apr 29, 2007
    #1
    1. Advertising

  2. 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
     
    Gregor Horvath, Apr 29, 2007
    #2
    1. Advertising

  3. dmitrey

    7stud Guest

    On Apr 29, 11:19 am, dmitrey <> wrote:
    >
    > callable(lambda-func) returnes False
    >


    I'm not seeing that. Try this:

    f = lambda x: x
    print callable(f)

    ---output:--
    True
     
    7stud, Apr 29, 2007
    #3
  4. dmitrey

    dmitrey Guest

    Thank you, I have fixed the bug
     
    dmitrey, Apr 29, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    4
    Views:
    498
    Guest
    Oct 13, 2004
  2. CRON
    Replies:
    24
    Views:
    201,874
    Adrienne Boswell
    Jun 20, 2006
  3. Johnny
    Replies:
    3
    Views:
    469
    Robert Kern
    Aug 23, 2005
  4. Hari Sekhon
    Replies:
    0
    Views:
    523
    Hari Sekhon
    Jun 20, 2006
  5. Replies:
    4
    Views:
    233
    Tad McClellan
    Jun 1, 2007
Loading...

Share This Page