Skip to content

Show HN: Methodfinder for Python

github.com/billsix
2 pointsbillsix1 comment
On HN

Comments

Many times, you know the input and output of a procedure that you know must exist, but can't remember the name.

Methodfinder finds the name. Let me know if you find it useful!

   >>> import methodfinder
   >>> methodfinder.find([]) == 0
   len([])
   sum([])
   >>> methodfinder.find([]) == False
   any([])
   bool([])
   callable([])
   >>> methodfinder.find(3) == "3"
   ascii(3)
   format(3)
   repr(3)
   str(3)
   >>> methodfinder.find([1,2,6,7], 6) == True
   6 in [1, 2, 6, 7]
   [1, 2, 6, 7].__contains__(6)
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.