On Mon, 17 Jul 2006 10:29:22 -0300, Johan Dahlin <[EMAIL PROTECTED]> wrote:
>I consider __getattribute__ a hack, being able to override __dict__ is less
>hackish, IMHO.
Why do you feel one is more "hackish" than the other? In my experience the
opposite is true: certain C APIs expect __dict__ to
Phillip J. Eby wrote:
> Just as a point of reference, the Importing package does something very
> similar, to support "weak" and "lazy" imports:
>
> http://cheeseshop.python.org/pypi/Importing
Interesting, I was not aware of that, thanks for the pointer.
Another reason for including this feature
James Y Knight wrote:
>
> On Jul 15, 2006, at 2:38 PM, Johan Dahlin wrote:
>> What I want to ask, is it possible to have a sanctioned way to implement
>> a dynamic module/namespace in python?
>>
>> For instance, it could be implemented to allow you to replace the
>> __dict__ attribute in a module
Andrew Bennetts wrote:
> On Sat, Jul 15, 2006 at 03:38:04PM -0300, Johan Dahlin wrote:
>> In an effort to reduce the memory usage used by GTK+ applications
>> written in python I've recently added a feature that allows attributes
>> to be lazy loaded in a module namespace. The gtk python module c
On Sun, Jul 16, 2006 at 11:52:48PM -0700, Josiah Carlson wrote:
> Andrew Bennetts <[EMAIL PROTECTED]> wrote:
[...]
> >
> > Have you seen the "demandload" hack that Mercurial uses? You can find it
> > here:
> > http://selenic.com/repo/hg?f=cb4715847a81;file=mercurial/demandload.py
> >
> > Yo
Andrew Bennetts <[EMAIL PROTECTED]> wrote:
> On Sat, Jul 15, 2006 at 03:38:04PM -0300, Johan Dahlin wrote:
> > In an effort to reduce the memory usage used by GTK+ applications
> > written in python I've recently added a feature that allows attributes
> > to be lazy loaded in a module namespace.
On Sat, Jul 15, 2006 at 03:38:04PM -0300, Johan Dahlin wrote:
> In an effort to reduce the memory usage used by GTK+ applications
> written in python I've recently added a feature that allows attributes
> to be lazy loaded in a module namespace. The gtk python module contains
> quite a few attri
On Jul 15, 2006, at 2:38 PM, Johan Dahlin wrote:
> What I want to ask, is it possible to have a sanctioned way to
> implement
> a dynamic module/namespace in python?
>
> For instance, it could be implemented to allow you to replace the
> __dict__ attribute in a module with a user provided object
At 03:38 PM 7/15/2006 -0300, Johan Dahlin wrote:
>In an effort to reduce the memory usage used by GTK+ applications
>written in python I've recently added a feature that allows attributes
>to be lazy loaded in a module namespace. The gtk python module contains
>quite a few attributes (around 850) o
Johan Dahlin wrote:
> My point is that I consider this to be a valid use case, the amount of
> saved memory is significan, and I could not find another way of doing
> it and still keep the gtk interface (import gtk; gtk.Button) to still be
> backwards compatible.
You may want to have a look at SI
In an effort to reduce the memory usage used by GTK+ applications
written in python I've recently added a feature that allows attributes
to be lazy loaded in a module namespace. The gtk python module contains
quite a few attributes (around 850) of which many are classes or
interfaces (150+)
Th
11 matches
Mail list logo