[Edu-sig] Interesting "gotcha"

Kirby Urner kurner at oreillyschool.com
Wed Mar 30 19:50:28 CEST 2011


What is a Python module? #==========================

Common answer is "a file containing Python source code?",
but I'm questioning whether that's sufficient definition.

How about an importable .pyc or .pyd, with no .py in the
picture.  That's a module too, no?

** Import Star #====================================

When is
import *
a good idea?

There's all this righteous moralistic hoopla that gets built up
against specific idioms, to where eval( ) appears to be fighting
for its very existence...  Mary wants to keep her little lambda.

So I'd rather phrase these in the positive, as in when IS it
a good idea... e.g. to use semi-colons between statements.

** Another student question:  #=========================

Why does all([]) return True by default?  Is this a case
of half full versus half empty?

** Correcting a misconception  #========================

No, docstrings do NOT have to be triple quoted.

Kirby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/edu-sig/attachments/20110330/4cbedcbd/attachment.html>


More information about the Edu-sig mailing list