seanfisk / python-project-template

A template Python project with a focus on best practices.
Other
543 stars 168 forks source link

Change entry point format. #23

Closed seanfisk closed 11 years ago

seanfisk commented 11 years ago

In main.py.tpl, rename main to entry_point and _main to main. The justification here is that Python code that calls the program's main will almost always want to pass arguments, in which case it would call the old _main. However, having a leading underscore indicates a private function.

This will also help when main is dependency injected, in which case we can have three functions: A zero-arg entry_point for setuptools, a main which is passed argv, and _main which is passed argv and the dependency-injected functions.