Re: apply()?

Discussion in 'Python' started by jepler@unpythonic.net, Dec 6, 2005.

  1. Guest

    First, get the method with getattr() and then use the *-notation or
    apply to call it with args.
    getattr(obj, func_name)(*args)
    or
    apply(getattr(obj, func_name), args)

    Jeff

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.1 (GNU/Linux)

    iD8DBQFDlNVIJd01MZaTXX0RAuxFAKCpZuMh589lrVsMYMkXb7Zinb+EQQCdFgPF
    S94/NDVkIl0wb+pjhB+XutI=
    =7Hhb
    -----END PGP SIGNATURE-----
    , Dec 6, 2005
    #1
    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. chan
    Replies:
    1
    Views:
    3,760
    Nico Debeuckelaere
    Mar 4, 2004
  2. Replies:
    3
    Views:
    393
  3. Markus Meng
    Replies:
    1
    Views:
    1,395
    Mike Treseler
    Jan 15, 2004
  4. Dirk Meusel
    Replies:
    1
    Views:
    3,014
    Dirk Meusel
    Aug 19, 2003
  5. Stefan Siegl
    Replies:
    1
    Views:
    962
    Marrow
    Jul 18, 2003
Loading...

Share This Page