On Fri, Nov 19, 2010 at 12:21 AM, Michael Foord email@example.com wrote:
On 18 November 2010 23:14, M.-A. Lemburg firstname.lastname@example.org wrote:
Greg Ewing wrote:
Georg Brandl wrote:
But to think of that, you already need to suspect circular imports, and then it's easy to see it from the traceback anyway.
Right. Whenever I've had a problem with circular imports, it was usually fairly obvious what the cause was.
Same here and most cases I've had in the past actually presented themselves as... ImportErrors :-)
If you use the "from module import something" form it will be an ImportError. If you do "import module" and then "module.something" you will see an AttributeError. These are the ones that can be confusing.
Yes that's the case I was thinking of. After years of Python I can still get trapped on those. But maybe that's just me :)