Gerardo Herzig a écrit :
> Bruno Desthuilliers wrote:
>
>> Gerardo Herzig a écrit :
>>
>>
>>> Carl Bank a écrit :
>>>
>>>
Add these lines in __init__.py:
from MYCLASSES.A import A
from MYCLASSES.B import B
>>>
>>> Ummm, that works indeed, but forces me
Gerardo Herzig <[EMAIL PROTECTED]> writes:
> If the original MYCLASSES.py has 5 different classes ,say A,B,C,D,E
> , each one has to be imported (as A and B) in order to be used for
> the client code. The thing is, there are more than 5 classes, and
> looks like a lot of unnecesary work to me, sin
Bruno Desthuilliers wrote:
>Gerardo Herzig a écrit :
>
>
>>Carl Bank a écrit :
>>
>>
>>>Add these lines in __init__.py:
>>>
>>>from MYCLASSES.A import A
>>>from MYCLASSES.B import B
>>>
>>>
>>>
>>>
>>Ummm, that works indeed, but forces me to import all (more than A and B)
>>classes,
Gerardo Herzig a écrit :
> Carl Bank a écrit :
>>
>> Add these lines in __init__.py:
>>
>> from MYCLASSES.A import A
>> from MYCLASSES.B import B
>>
>>
> Ummm, that works indeed, but forces me to import all (more than A and B)
> classes, rigth?
Why so ?
--
http://mail.python.org/mailman/listi
>
>
>
>>>On Oct 3, 2007, at 11:42 AM, Gerardo Herzig wrote:
>>>
>>>
>>>
Hi all. I have a single file with several classes, wich i want to
separate into several packages.
The big file is named, say MYCLASES, and contains a class named
A(object), and B(A).
We have be
Bruno Desthuilliers <[EMAIL PROTECTED]> writes:
>> We agree on that. It is the OP who *wants* to access his modules
>> directly without ever naming the package.
>
> To be exact, he wants to reorganize it's source code (splitting a
> file that's getting too big AFAICT)
You're right, I misread his
Hrvoje Niksic a écrit :
> Bruno Desthuilliers <[EMAIL PROTECTED]> writes:
>
>> it's quite common to use the __init__.py of the package (as
>> explained by Ben) as a facade to the internal organization of the
>> package, so you can change this internal organization without
>> breaking client code.
Bruno Desthuilliers <[EMAIL PROTECTED]> writes:
> it's quite common to use the __init__.py of the package (as
> explained by Ben) as a facade to the internal organization of the
> package, so you can change this internal organization without
> breaking client code.
We agree on that. It is the OP
Hrvoje Niksic a écrit :
> [EMAIL PROTECTED] writes:
>
>> I will expose my case quicly.
>> The MYCLASES.py file contains the A class, so i can use
>> from MYCLASES import A
>> a = ()
>>
>> Using the "package mode" (wich looks fine BTW), having the simple
>> MYCLASES/
>> __init__.py
>> A.p
[EMAIL PROTECTED] writes:
> I will expose my case quicly.
> The MYCLASES.py file contains the A class, so i can use
> from MYCLASES import A
> a = ()
>
> Using the "package mode" (wich looks fine BTW), having the simple
> MYCLASES/
> __init__.py
> A.py
>
> forces my (i guess) to use the
On Wed, 03 Oct 2007 22:28:57 -0300, gherzig wrote:
>> On Oct 3, 2007, at 11:42 AM, Gerardo Herzig wrote:
>>
>>> Hi all. I have a single file with several classes, wich i want to
>>> separate into several packages.
>>> The big file is named, say MYCLASES, and contains a class named
>>> A(object),
[EMAIL PROTECTED] writes:
> The MYCLASES.py file contains the A class, so i can use
> from MYCLASES import A
> a = ()
>
> Using the "package mode" (wich looks fine BTW), having the simple
> MYCLASES/
> __init__.py
> A.py
>
> forces my (i guess) to use the
> from MYCLASES.A import A
Y
>
> On Oct 3, 2007, at 11:42 AM, Gerardo Herzig wrote:
>
>> Hi all. I have a single file with several classes, wich i want to
>> separate into several packages.
>> The big file is named, say MYCLASES, and contains a class named
>> A(object), and B(A).
>>
>> We have been using this MYCLASES in the
>
On Oct 3, 2007, at 11:42 AM, Gerardo Herzig wrote:
> Hi all. I have a single file with several classes, wich i want to
> separate into several packages.
> The big file is named, say MYCLASES, and contains a class named
> A(object), and B(A).
>
> We have been using this MYCLASES in the
> from MYCL
Hi all. I have a single file with several classes, wich i want to
separate into several packages.
The big file is named, say MYCLASES, and contains a class named
A(object), and B(A).
We have been using this MYCLASES in the
from MYCLASES import B syntax, but i cant reproduce this syntax using
pa
15 matches
Mail list logo