Package proton :: Module _wrapper :: Class Wrapper
[frames] | no frames]

Class Wrapper

source code

object --+
         |
        Wrapper

Wrapper for python objects that need to be stored in event contexts and be retrived again from them
Quick note on how this works:
The actual *python* object has only 3 attributes which redirect into the wrapped C objects:
_impl   The wrapped C object itself
_attrs  This is a special pn_record_t holding a PYCTX which is a python dict
        every attribute in the python object is actually looked up here
_record This is the C record itself (so actually identical to _attrs really but
        a different python type

Because the objects actual attributes are stored away they must be initialised *after* the wrapping
is set up. This is the purpose of the _init method in the wrapped  object. Wrapper.__init__ will call
eht subclass _init to initialise attributes. So they *must not* be initialised in the subclass __init__
before calling the superclass (Wrapper) __init__ or they will not be accessible from the wrapper at all.

Instance Methods
 
__init__(self, impl_or_constructor, get_context=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__getattr__(self, name) source code
 
__setattr__(self, name, value)
x.__setattr__('name', value) <==> x.name = value
source code
 
__delattr__(self, name)
x.__delattr__('name') <==> del x.name
source code
 
__hash__(self)
hash(x)
source code
 
__eq__(self, other) source code
 
__ne__(self, other) source code
 
__del__(self) source code
 
__repr__(self)
repr(x)
source code

Inherited from object: __format__, __getattribute__, __new__, __reduce__, __reduce_ex__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, impl_or_constructor, get_context=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__setattr__(self, name, value)

source code 

x.__setattr__('name', value) <==> x.name = value

Overrides: object.__setattr__
(inherited documentation)

__delattr__(self, name)

source code 

x.__delattr__('name') <==> del x.name

Overrides: object.__delattr__
(inherited documentation)

__hash__(self)
(Hashing function)

source code 

hash(x)

Overrides: object.__hash__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)