Boost logo

Boost-Build :

Subject: [Boost-build] [python] imports style
From: Vladimir Prus (ghost_at_[hidden])
Date: 2010-07-13 15:21:02


It turned out, suddenly, that I don't have much experience creating large Python
application from scratch, so need some help on basics. Suppose I have
tools/build/v2/build/toolset.py, which reads like this:

        import feature, property, generators, property_set
        from b2.util.utility import *
        from b2.util import set

The modules referred to by the first 'import' line are in the same directory
as toolset.py. Is this considered OK style, or I should do:

        import b2.build.feature, b2.build.property, b2.build.generators, b2.build.property_set
        from b2.util.utility import *
        from b2.util import set

? If the second form is preferrable, is there way to use 'feature.whatever' in the code,
as opposed to 'b2.build.feature.whatever'?

Thanks,

--
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build: http://boost.org/boost-build2

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk