Peter Otten wrote:
> Ulrich Eckhardt wrote:
>> So, short follow-up question: Why does this work?
>
> __getattr__() is a fallback that is only tried when the normal lookup
> fails. If you need to intercept every attribute lookup use
> __getattribute__() instead:
Thank you Peter, that was the missi
Ulrich Eckhardt wrote:
> Peter Otten wrote:
>> Use getattr()
>>
> class W(object):
>> ... def __init__(self, wrapped): self._wrapped = wrapped
>> ... def __getattr__(self, name):
>> ... return getattr(self._wrapped, name)
>> ...
>
> I thought there was something like this
Peter Otten wrote:
> Use getattr()
>
class W(object):
> ... def __init__(self, wrapped): self._wrapped = wrapped
> ... def __getattr__(self, name):
> ... return getattr(self._wrapped, name)
> ...
I thought there was something like this, thanks! :)
When I read this, I tho
On Tue, Aug 10, 2010 at 2:01 AM, Ulrich Eckhardt
wrote:
> Hi!
>
> I have an extension module (a plugin written with Boost.Python) and around
> that a wrapper class that adapts a few things. Since the module is a
> plugin, there are multiple implementations of this. What I'm currently
> doing is th
Ulrich Eckhardt wrote:
> Hi!
>
> I have an extension module (a plugin written with Boost.Python) and around
> that a wrapper class that adapts a few things. Since the module is a
> plugin, there are multiple implementations of this. What I'm currently
> doing is this:
>
> plugin = __import__(pl
Hi!
I have an extension module (a plugin written with Boost.Python) and around
that a wrapper class that adapts a few things. Since the module is a
plugin, there are multiple implementations of this. What I'm currently
doing is this:
plugin = __import__(plugin_name)
class PluginWrapper(plugin.