Ian Bicking: the old part of his blog


I am in favor of versioned imports. I do not have a problem with a directive with "==" or any other boolean operator. I somehow think an 'if' needs to be in there as well as some try/catch mechanism. Maybe all built in to some easy to understand/read syntax.

What concerns me most is a standard way to specify version. With so many places to indicate this and in so many different ways I am afraid that it will be very confusing to remember, find and keep the version. I almost feel that it would be better to have a __version__.py file much like the __init__.py file in the root of a module. Then the file will always contain a float of the major and minor version number. Likewise, I do not see a reason why disutils could not generate this file (when it does not already exist) from one of many other ways. Lastly, if may be helpful to allow the float to be calculated in a single string from a Revision number or by other means. Example content of __version__.py file:

float( "$Revision 1.11 $"[10:-2] )

or just:


Comment on Versioned Imports
by Brian Ray