[RFC] Changes to 'selftest --starting-with'

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue Aug 26 09:03:05 BST 2008


>>>>> "Harald" == Harald Meland <harald.meland at usit.uio.no> writes:

    Harald> [Vincent Ladeuil]
    >> I'd like to find a solution that do not conflict with valid
    >> package names.
    >> 
    >> One is to use '.' as the leading character so that we can do:
    >> 
    >> .bt => bzrlib.tests
    >> .bp => bzrlib.plugins
    >> .gtk => bzrlib.plugins.gtk

    Harald> PEP 328 uses leading dot(s) in the package name part of import
    Harald> statements to indicate that the import should be relative, so the
    Harald> above alias syntax will probably become somewhat confusing when such
    Harald> relative imports become a more widely known feature.

That's where I got the idea.

Why do you find it confusing though ? This will only be used on
the command line, not inside a python package.

It could even be documented as: "Prefixes can be viewed as
'import bzrlib.tests as bt' inside a fictional command-line
python name space".

Does that address the confusion ?

     Vincent



More information about the bazaar mailing list