(self)
Transform this object into a custom VBase subclass.

        transformToNative should always return a representation of this object.
        It may do so by modifying self in place then returning self, or by
        creating a new object.
Transform this object into a custom VBase subclass.
Transform this object into a custom VBase subclass .
def transformToNative(self):
        """
        Transform this object into a custom VBase subclass.

        transformToNative should always return a representation of this object.
        It may do so by modifying self in place then returning self, or by
        creating a new object.
        """
        if self.isNative or not self.behavior or not self.behavior.hasNative:
            return self
        else:
            try:
                return self.behavior.transformToNative(self)
            except Exception as e:
                # wrap errors in transformation in a ParseError
                lineNumber = getattr(self, 'lineNumber', None)

                if isinstance(e, ParseError):
                    if lineNumber is not None:
                        e.lineNumber = lineNumber
                    raise
                else:
                    msg = "In transformToNative, unhandled exception on " \
                          "line %s: %s: %s"
                    msg = msg % (lineNumber, sys.exc_info()[0],
                                 sys.exc_info()[1])
                    raise ParseError(msg, lineNumber)
def transformToNative ( self ) : if self . isNative or not self . behavior or not self . behavior . hasNative : return self else : try : return self . behavior . transformToNative ( self ) except Exception as e : # wrap errors in transformation in a ParseError lineNumber = getattr ( self , 'lineNumber' , None ) if isinstance ( e , ParseError ) : if lineNumber is not None : e . lineNumber = lineNumber raise else : msg = "In transformToNative, unhandled exception on " "line %s: %s: %s" msg = msg % ( lineNumber , sys . exc_info ( ) [ 0 ] , sys . exc_info ( ) [ 1 ] ) raise ParseError ( msg , lineNumber )