Bug 369265 - Autocomplete __main__ check
Summary: Autocomplete __main__ check
Status: REPORTED
Alias: None
Product: kdev-python
Classification: Developer tools
Component: Code completion (show other bugs)
Version: 5.0.1
Platform: Appimage Linux
: NOR wishlist
Target Milestone: 1.7.3
Assignee: Sven Brauch
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-23 23:54 UTC by Nicolás Alvarez
Modified: 2016-09-23 23:54 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolás Alvarez 2016-09-23 23:54:35 UTC
KDevelop currently autocompletes the Python shebang and the encoding declaration, at appropriate places in the file and if they aren't already present.

It would be useful to also complete other common boilerplate constructs, such as:
if __name__ == "__main__":

which checks if the current module is being executed directly by the Python interpreter, and not imported from something else. Maybe it could complete the == "__main__" part after seeing the "if __name__" part.