Deleted Added
sdiff udiff text old ( 13719:74853963ddcf ) new ( 13764:1647bbdc9444 )
full compact
1# Copyright (c) 2017-2018 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 868 unchanged lines hidden (view full) ---

877
878def cxxMethod(*args, **kwargs):
879 """Decorator to export C++ functions to Python"""
880
881 def decorate(func):
882 name = func.__name__
883 override = kwargs.get("override", False)
884 cxx_name = kwargs.get("cxx_name", name)
885
886 args, varargs, keywords, defaults = inspect.getargspec(func)
887 if varargs or keywords:
888 raise ValueError("Wrapped methods must not contain variable " \
889 "arguments")
890
891 # Create tuples of (argument, default)
892 if defaults:

--- 8 unchanged lines hidden (view full) ---

901 ccobj = self.getCCObject()
902 return getattr(ccobj, name)(*args, **kwargs)
903
904 @wraps(func)
905 def py_call(self, *args, **kwargs):
906 return func(self, *args, **kwargs)
907
908 f = py_call if override else cxx_call
909 f.__pybind = PyBindMethod(name, cxx_name=cxx_name, args=args)
910
911 return f
912
913 if len(args) == 0:
914 return decorate
915 elif len(args) == 1 and len(kwargs) == 0:
916 return decorate(*args)
917 else:

--- 762 unchanged lines hidden ---