[TSBOAPOOOWTDI]using names from modules

Paul Moore p.f.moore at gmail.com
Sun Nov 5 14:18:43 EST 2017


On 5 November 2017 at 13:54, Stefan Ram <ram at zedat.fu-berlin.de> wrote:
> Paul Moore <p.f.moore at gmail.com> writes:
>>But regardless, the Zen isn't intended to be taken quite as literally
>>as the OP was trying to do. It's a statement of principles, not a set
>>of rules.
>
>   What I am looking for is a default notation to use in my
>   beginner's tutorial and also to recommand for beginners.

Then "import math" at the top of the file, and refer to module
functions as "math.sin".

That's the normal approach you'd see in pretty much every Python
project on the web, so "follow normal practice" applies. By the time
your students know enough to ask if there's a way to avoid needing to
repeat "math" (and understand the answer) they are likely to be
experienced enough to judge which option is better in a given
situation.

Paul



More information about the Python-list mailing list