Re: has_method (solution found)

From: Gandalf (gandalf_at_geochemsource.com)
Date: 08/31/04


Date: Tue, 31 Aug 2004 15:28:54 +0200
To: python-list@python.org


Somebody sent me a private e-mail.
It must be common for such silly questions that would just spam the
list. :-)
I'll write down the final solution anyway.

def getmethod(name):
    methodList = [e for e in dir(self) if callable(getattr(self, e))]
    if name in methodList:
       return getattr(self,name)
    else:
       return None

Thanks for all.

   Laci 2.0



Relevant Pages

  • Re: VGER does gradual SPF activation (FAQ matter)
    ... It took /years/ until open relays weren't common anymore... ... And it will take years to somwhat get a grip on the the spam ... since they had almost no reverse DNS zones ...
    (Linux-Kernel)
  • Re: OT: Joeturn, the lastest RGP weirdo
    ... Is common place on usenet mccard if you have nothing to hide and ... everything to gain! ...
    (rec.gambling.poker)
  • Re: Spam to domain names.
    ... >> The point is that all that sort of Information is listed in various ... >> The Name of a Person is normally listed in the WHOIS Info for a Domain. ... > names have got the exact same spam but no other spam? ... Bit common is that, doesn't take a lot of guessing. ...
    (uk.people.silversurfers)
  • Re: A fictional blackhat adventure
    ... find comment spam in blogs and guestbooks ... look what they have in common, ...
    (alt.internet.search-engines)
  • Re: Spam to domain names.
    ... >> Bit common is that, doesn't take a lot of guessing. ... The spam merchants have tools at their disposal to ferret out ... > Yep there is a catchall folder but Plusnet have started marking them as spam ... Catchall email addresses should never be used. ...
    (uk.people.silversurfers)