> Heiko Wundram <[EMAIL PROTECTED]> (HW) schreef:
>HW> from x import test as x
>HW> print x.one
>HW> print x.two
>HW> print x.three
Or replace test by x in x.py :=)
--
Piet van Oostrum <[EMAIL PROTECTED]>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: [EMAIL PROTECTED]
Am Mittwoch 24 Mai 2006 15:43 schrieb Piet van Oostrum:
> > Heiko Wundram <[EMAIL PROTECTED]> (HW) wrote:
> >
> >HW> y.py
> >HW> ---
> >HW> from x import test
> >HW> print test.one
> >HW> print test.two
> >HW> print test.three
> >HW> ---
>
> Or even:
> import x
> x = x.test
> print x.one
> prin
> Heiko Wundram <[EMAIL PROTECTED]> (HW) wrote:
>HW> y.py
>HW> ---
>HW> from x import test
>HW> print test.one
>HW> print test.two
>HW> print test.three
>HW> ---
Or even:
import x
x = x.test
print x.one
print x.two
print x.three
--
Piet van Oostrum <[EMAIL PROTECTED]>
URL: http://www.cs.uu.
> > Is there something analogous to __getattr__ for modules?
> >
> > I know how to create a class that has attributes from a list and
> > nothing else by overloading __getattr__ and making sure that the
> > accessed attribute appears in my list. Now I would like to do the same
> > with a module, sa
Am Sonntag 21 Mai 2006 21:52 schrieb Daniel Nogradi:
> Is there something analogous to __getattr__ for modules?
>
> I know how to create a class that has attributes from a list and
> nothing else by overloading __getattr__ and making sure that the
> accessed attribute appears in my list. Now I woul
Is there something analogous to __getattr__ for modules?
I know how to create a class that has attributes from a list and
nothing else by overloading __getattr__ and making sure that the
accessed attribute appears in my list. Now I would like to do the same
with a module, say x.py, in which I have