strange(?) module import syntax

Posted by morpheous on Stack Overflow See other posts from Stack Overflow or by morpheous
Published on 2010-06-01T13:46:59Z Indexed on 2010/06/01 13:53 UTC
Read the original article Hit count: 119

Filed under:

I've come across the following code in a Python script

from pprint import pprint

why not simply import pprint?

Unless the module pprint contains a function called pprint which is being aliased as pprint (surely, this must be the definition of madness?)

© Stack Overflow or respective owner

Related posts about python