Source

rope_py3k / rope / base / oi / __init__.py

"""Rope object analysis and inference package

Rope makes some simplifying assumptions about a python program.  It
assumes that a program only performs assignments and function calls.
Tracking assignments is simple and `PyName` objects handle that.  The
main problem is function calls.  Rope uses these two approaches for
obtaining call information:

* Static object analysis: `rope.base.pycore.PyCore.analyze_module()`

  It can analyze modules to obtain information about functions.  This
  is done by analyzing function calls in a module or scope.  Currently
  SOA analyzes the scopes that are changed while saving or when the
  user asks to analyze a module.  That is mainly because static
  analysis is time-consuming.

* Dynamic object analysis: `rope.base.pycore.PyCore.run_module()`

  When you run a module or your testsuite, when DOA is enabled, it
  collects information about parameters passed to and objects returned
  from functions.  The main problem with this approach is that it is
  quite slow; Not when looking up the information but when collecting
  them.

An instance of `rope.base.oi.objectinfo.ObjectInfoManager` can be used
for accessing these information.  It saves the data in a
`rope.base.oi.objectdb.ObjectDB` internally.

Now if our objectdb does not know anything about a function and we
need the value returned by it, static object inference, SOI, comes
into play.  It analyzes function body and tries to infer the object
that is returned from it (we usually need the returned value for the
given parameter objects).

Rope might collect and store information for other `PyName`\s, too.
For instance rope stores the object builtin containers hold.

"""
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.