Bug 325090 - JJ: Ensure proper documentation is provided for commonly used modules
Summary: JJ: Ensure proper documentation is provided for commonly used modules
Status: CONFIRMED
Alias: None
Product: kdev-python
Classification: Developer tools
Component: Documentation data (other bugs)
Version First Reported In: git master
Platform: unspecified Linux
: NOR normal
Target Milestone: 1.6.0
Assignee: Sven Brauch
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-19 13:27 UTC by Sven Brauch
Modified: 2021-03-09 23:42 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Brauch 2013-09-19 13:27:05 UTC
Our support for the very basic built-in modules, like sys, os etc. is currently read from the files python uses too, i.e. /usr/lib/pythonx.y/os.py. That works to varying degrees -- for example, os.gecwd() is imported in a fancy way from the C POSIX builtins, and is thus not there.

A clever, but a bit complicated way to solve this would be:
 1) Add a file called os.py to documentation_files/. In there, do "from os import *", and then "def getcwd(): return str()" or something.
 2) Hack ContextBuilder::findModulePath (kdev-python/duchain/contextbuilder.cpp) to search in the system directories *before* those from Helper::getDataDirs() in case the currently parsed file is in those data dirs already. That'll ensure the "from os import *" will indeed pick up the system's os module.

A simpler solution, which might also be ok for different, smaller modules than os is just copying the system file to documentation_files and modifying it there, or just creating a new "pseudo" implementation of the module which just defines the functions and has docstrings, but doesn't actually implement anything.

Reproducible: Always
Comment 1 Sven Brauch 2016-01-31 00:43:03 UTC
Next in list: sys. sys.stdin and stuff should really work properly.
Comment 2 Sven Brauch 2016-02-02 18:04:40 UTC
sys is done now, another one which is always shaky is re.
Comment 3 Justin Zobel 2021-03-09 23:42:29 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.