Bug 369265

Summary: Autocomplete __main__ check
Product: [Developer tools] kdev-python Reporter: Nicolás Alvarez <nalvarez>
Component: Code completionAssignee: Sven Brauch <mail>
Status: REPORTED ---    
Severity: wishlist    
Priority: NOR    
Version First Reported In: 5.0.1   
Target Milestone: 1.7.3   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

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.