473,467 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Has Python 2.4.1 changed implementation for __init__.py???

Hallo,
I just downloaded http://www.python.org/pypi/xexpr/0.02, installed
if (python setup.py install) and tried the example in the README file.

Than I got following error: AttributeError: 'module' object has no
attribute 'Read'

This is same behavior for all module using empty __init__.pr files,
like venster, Pyrex or libxmlmods...

Is there a change in the implementation, so that every module needs an
explicit list for exchanged modules? Or is there a switch or an
environment variable to change?
Thanks a lot
Werner
EXAMPLE
------------------------------------------------------------------------

Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
import xexpr
example = '<foo a="b" c="d"><bar><baz a="d" />Blah</bar></foo>'
xexpr.Read.to_xexpr(example) Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: 'module' object has no attribute 'Read'

Jul 18 '05 #1
2 1287
Werner Merkl wrote:
I just downloaded http://www.python.org/pypi/xexpr/0.02, installed
if (python setup.py install) and tried the example in the README file.

Than I got following error: AttributeError: 'module' object has no attribute 'Read'

This is same behavior for all module using empty __init__.pr files,
like venster, Pyrex or libxmlmods...
if "xexpr" is a package with an empty __init__.py file, the behaviour you're
seeing is the expected behaviour. importing a toplevel module doesn't auto-
matically import any submodules.
Is there a change in the implementation, so that every module needs an
explicit list for exchanged modules?
what's an "exchanged module"?
EXAMPLE
------------------------------------------------------------------------

Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import xexpr
example = '<foo a="b" c="d"><bar><baz a="d" />Blah</bar></foo>'
xexpr.Read.to_xexpr(example) Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: 'module' object has no attribute 'Read'


does it work better if you type

import xexpr.Read

before you call the to_xexpr function?

</F>

Jul 18 '05 #2
Fredrik Lundh wrote:
Werner Merkl wrote:

I just downloaded http://www.python.org/pypi/xexpr/0.02, installed
if (python setup.py install) and tried the example in the README file.

Than I got following error: AttributeError: 'module' object has no attribute 'Read'

This is same behavior for all module using empty __init__.pr files,
like venster, Pyrex or libxmlmods...

if "xexpr" is a package with an empty __init__.py file, the behaviour you're
seeing is the expected behaviour. importing a toplevel module doesn't auto-
matically import any submodules.

Oh, I see. I have to write:
import xexpr.Read

Now it works...
Is there a change in the implementation, so that every module needs an
explicit list for exchanged modules?

what's an "exchanged module"?

Oops! This should say "every module"...

Thanx a lot
Werner
EXAMPLE
------------------------------------------------------------------------

Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>import xexpr
>example = '<foo a="b" c="d"><bar><baz a="d" />Blah</bar></foo>'
>xexpr.Read.to_xexpr(example)


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


does it work better if you type

import xexpr.Read

before you call the to_xexpr function?

</F>

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: gangesmaster | last post by:
let's start with a question: ========== >>> class z(object): .... def __init__(self): .... self.blah=5 .... >>> class x(object): .... def __init__(self): .... ...
267
by: Xah Lee | last post by:
Python, Lambda, and Guido van Rossum Xah Lee, 2006-05-05 In this post, i'd like to deconstruct one of Guido's recent blog about lambda in Python. In Guido's blog written in 2006-02-10 at...
0
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 393 open (+15) / 3315 closed (+17) / 3708 total (+32) Bugs : 908 open (+22) / 5975 closed (+49) / 6883 total (+71) RFE : 223 open...
112
by: mystilleef | last post by:
Hello, What is the Pythonic way of implementing getters and setters. I've heard people say the use of accessors is not Pythonic. But why? And what is the alternative? I refrain from using them...
20
by: Mr.SpOOn | last post by:
Hi, I need a structure to represent a set of integers. I also need to perform on this set some basic set operations, such as adding or removing elements, joining with other sets and checking for...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.