Easy ways to investigate unknown Python APIs -


While studying a snippet of unknown Python code, I sometimes

  varName Method ()  

pattern.

To find out what is it, I will study more code, to find out where its varName was instantiated, to find its type. So if an example of varName class class name proves, then I knew methodName () class name . Sometimes varName == self and methodName () is a method of this class, or a method somebody Inherited from other classes, if the present square is in sub-sections of some other classes.

There can take as input a quick way / tool 'methodName' you can scan all installed Python modules and to which class that can show methodName () ?

This is the closest thing Aipyathon related to I if I type a class name, dot ( ".") Tab, it can show the class members, I have a class Instead, I could use the name of an object (which is an example of a certain class) and it will also work as soon as I choose the name of one of the options provided, I '?' Or '??'

I wonder if the ipyathon can only do some intelligent scanning based on the 'methodName' string.

If you know the options of the iPython, which may possibly help, please suggest them.

Edit: As per the request, I am explicitly adding that I would like a way to find ways of method name not only in Pathhen source code. There are a lot of files in some Python packages (especially PEATT), and iPython is fully capable of completing them before importing it first. So a plain text search like grep (or even CTAG) will not work here.

you

once you've installed (how to do this on your platform ), Run it on your files:

  $ / usr / local / bin / ctags * py  

(You can upload an existing tag file It can run multiple times to attach tags, recurs it in subdirectories, etc. with command line options) and it makes a tag file like the following (for short) Same python fai For I am defining a method with a class):

  $ cat tag! _TAG_FILE_FORMAT 2 / extended format; --format = 1 will not be attached; "Lines arranged without !! _TAG_FILE_SORTED 1/0 = a, 1 = sorted, 2 = bunch !! _TAG_PROGRAM_AUTHOR Darren Hiabert / Diaciibr @ users.sourceforge.net/! _TAG_PROGRAM_NAME Aksbarent Sitiaji //! _TAG_PROGRAM_URL Http: // ctags .sourceforge.net / Official site !! _TAG_PROGRAM_VERSION 5.7 / / Foo a.py / ^ class Foo (object): $ /; C amethod a.py / ^ def amethod (self): pass $ /; "m class: Fu  

now, quote:

say that when you search for a function call that you want to see the definition, simply pointing the cursor at the function And c Press trl] and it will bring you there. If you want to come back, just press Ctrl. Instead of Ctrl, I want to use ctrl i and ctrl o to move the check points back and forth.

In addition, for the identifier found in control-P (some attempts) code completion tag (VIM will give you more details in the : support tag ).


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -