xml.dom's weirdness?

Fredrik Lundh fredrik at pythonware.com
Sat Jul 26 03:29:54 EDT 2008


Lie wrote:

> Why this generates AttributeError, then not?
> 
> Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30)
> [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import xml
>>>> xml.dom
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> AttributeError: 'module' object has no attribute 'dom'
>>>> xml.dom
> <module 'xml.dom' from '/usr/lib/python2.5/xml/dom/__init__.pyc'>

this is what I get, on both Windows and Linux:

 >>> import xml
 >>> xml.dom
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'dom'
 >>> xml.dom
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'dom'

</F>




More information about the Python-list mailing list