Lets say I’m in a file called openid.py and I do :
from openid.consumer.discover import discover, DiscoveryFailure
I have the openid module on my pythonpath but the interpreter seems to be trying to use my openid.py file. How can I get the library version?
(Of course, something other than the obvious ‘rename your file’ answer would be nice).
Thats the reason absolute imports have been chosen as the new default behaviour. However, they are not yet the default in 2.6 (maybe in 2.7…). You can get their behaviour now by importing them from the future:
You can find out more about this in the PEP metnioned by Nick or (easier to understand, I think) in the document “What’s New in Python 2.5”.