[Tutor] Python OO

Mark Lawrence breamoreboy at yahoo.co.uk
Sun Mar 29 19:38:18 CEST 2015


On 29/03/2015 18:30, Juan C. wrote:
> On Sun, Mar 29, 2015 at 3:56 AM Ben Finney <ben+python at benfinney.id.au>
> wrote:
> As a side issue: You apparently intend to choose names that are English
> language.
>
> If that's true, you should know that “actor”, “movie”, “series” are all
> singular.
>
> My bad, it's series indeed.
>
>
> On Sun, Mar 29, 2015 at 10:33 AM Dave Angel <davea at davea.name> wrote:
> I'd suggest that you NEVER call a module __main__.py The name
> "__main__" is reserved for identifying the script file, and is faked
> during the program initialization.
>
> By using that name for an imported file, you could get some very
> confusing errors later.
>
> As Peter said, I'm using __main__.py so that I can invoke the the app like
> 'python pycinema' in the console. A bunch of people recommend this approach.
>
>
> On Sun, Mar 29, 2015 at 11:31 AM Mark Lawrence <breamoreboy at yahoo.co.uk>
> wrote:
> No.
>
> We're talking Python, not Java. Some modules run to 1000s of lines, a
> couple of hundred is just peanuts.
>
> Ok, so you recommend me to have only 2 modules? One for the MDB API and one
> for the app inside the pycinema package and then my __main__.py on the
> folder root?

If that is the best solution for your problem then yes.  I believe it 
was Albert Einstein who said something like "Make it as simple as 
possible, but no simpler".

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence



More information about the Tutor mailing list