[Tutor] Python OO

Dave Angel davea at davea.name
Sun Mar 29 15:32:31 CEST 2015


On 03/28/2015 09:16 PM, Juan C. wrote:
> Ok, so, let me try to express what I think is 'right' here according to
> what you said.
>
> My code structure needs to be something like that:
>
> pycinema
> - package: pycinema
> - - __init__.py
> - - api.py
> - - actor.py
> - - movie.py
> - - serie.py
> - __main__.py
>

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.

-- 
DaveA


More information about the Tutor mailing list