diff --git a/example/example1.ref b/example/example1.ref index deeb40c6c..37c7fef9a 100644 --- a/example/example1.ref +++ b/example/example1.ref @@ -1,18 +1,16 @@ Called Example1 default constructor.. Called Example1 constructor with value 32.. Called Example1 copy constructor with value 32.. -Called Example1 move constructor with value 32.. -Called Example1 move constructor with value 32.. +Called Example1 copy constructor with value 32.. +Called Example1 destructor (32) Called Example1 destructor (32) -Called Example1 destructor (0) -Called Example1 destructor (0) -Called Example1 copy constructor with value 320.. -Called Example1 copy constructor with value 320.. -Called Example1 destructor (320) -Called Example1 destructor (320) Instance 1: Example1[value=320] Instance 2: Example1[value=32] +Called Example1 copy constructor with value 320.. +Called Example1 copy constructor with value 320.. +Called Example1 destructor (320) Example1[value=320] +Called Example1 destructor (320) Example1[value=320] Example1[value=320] Example1[value=320] diff --git a/example/example10.ref b/example/example10.ref new file mode 100644 index 000000000..517bb9084 --- /dev/null +++ b/example/example10.ref @@ -0,0 +1,35 @@ +(6+14j) +my_func(x:int=1, y:float=2, z:float=3) +6.0 +my_func(x:int=1, y:float=2, z:float=3) +6.0 +my_func(x:int=1, y:float=2, z:float=3) +my_func(x:int=3, y:float=4, z:float=3) +[ 6. 36.] +my_func(x:int=1, y:float=2, z:float=3) +my_func(x:int=3, y:float=4, z:float=3) +my_func(x:int=5, y:float=6, z:float=3) +my_func(x:int=7, y:float=8, z:float=3) +my_func(x:int=9, y:float=10, z:float=3) +my_func(x:int=11, y:float=12, z:float=3) +[[ 6. 36. 90.] + [ 168. 270. 396.]] +[[ 6 36 90] + [168 270 396]] +my_func(x:int=1, y:float=2, z:float=3) +6.0 +my_func(x:int=1, y:float=2, z:float=3) +6.0 +my_func(x:int=1, y:float=2, z:float=3) +my_func(x:int=3, y:float=4, z:float=3) +[ 6. 36.] +my_func(x:int=1, y:float=2, z:float=3) +my_func(x:int=3, y:float=4, z:float=3) +my_func(x:int=5, y:float=6, z:float=3) +my_func(x:int=7, y:float=8, z:float=3) +my_func(x:int=9, y:float=10, z:float=3) +my_func(x:int=11, y:float=12, z:float=3) +[[ 6. 36. 90.] + [ 168. 270. 396.]] +[[ 6 36 90] + [168 270 396]] diff --git a/example/example11.ref b/example/example11.ref new file mode 100644 index 000000000..cfcfe419d --- /dev/null +++ b/example/example11.ref @@ -0,0 +1,19 @@ +Help on built-in function kw_func + +kkww__ffuunncc(...) + Signature : (x : int32_t, y : int32_t) -> None + +Help on built-in function kw_func2 + +kkww__ffuunncc22(...) + Signature : (x : int32_t = 100, y : int32_t = 200) -> None + +kw_func(x=5, y=10) +kw_func(x=5, y=10) +kw_func(x=5, y=10) +kw_func(x=100, y=200) +kw_func(x=5, y=200) +kw_func(x=5, y=200) +kw_func(x=100, y=10) +kw_func(x=5, y=10) +kw_func(x=5, y=10) diff --git a/example/example12.ref b/example/example12.ref new file mode 100644 index 000000000..be6d09211 --- /dev/null +++ b/example/example12.ref @@ -0,0 +1,11 @@ +Constructing Example12.. +Original implementation of Example12::run(state=10, value=20) +30 +Caught expected exception: Tried to call pure virtual function "pure_virtual" +Constructing Example12.. +ExtendedExample12::run(20), calling parent.. +Original implementation of Example12::run(state=11, value=21) +32 +ExtendedExample12::pure_virtual(): Hello world +Destructing Example12.. +Destructing Example12.. diff --git a/example/example2.ref b/example/example2.ref index 8367f2066..341fcb2f3 100644 --- a/example/example2.ref +++ b/example/example2.ref @@ -1,91 +1,95 @@ -key: key, value=value +15 +5 +Example2: No constructor defined! +can't set attribute key: key2, value=value2 key: key, value=value +key: key, value=value key: key2, value=value2 Entry at positon 0: value list item 0: overwritten list item 1: value2 list item 0: value list item 1: value2 -15 -5 -example.Example2: No constructor defined! -can't set attribute This exception was intentionally thrown. -('test', True) -(5, 'test', True) +(u'test', True) +(5L, u'test', True) Help on class Example2 in module example -class EExxaammppllee22(builtins.object) +class EExxaammppllee22(__builtin__.object) + | Example 2 documentation + | | Methods defined here: | - | ____iinniitt____(self, /, *args, **kwargs) - | Initialize self. See help(type(self)) for accurate signature. + | ____iinniitt____(...) + | x.__init__(...) initializes x; see help(type(x)) for signature | - | ____nneeww____ = - | ggeett__ddiicctt(...) from builtins.PyCapsule - | Signature : get_dict(Example2) -> dict + | ggeett__ddiicctt(...) + | Signature : (Example2) -> dict | | Return a Python dictionary | - | ggeett__ddiicctt__22(...) from builtins.PyCapsule - | Signature : get_dict_2(Example2) -> dict + | ggeett__ddiicctt__22(...) + | Signature : (Example2) -> dict | | Return a C++ dictionary | - | ggeett__lliisstt(...) from builtins.PyCapsule - | Signature : get_list(Example2) -> list + | ggeett__lliisstt(...) + | Signature : (Example2) -> list | | Return a Python list | - | ggeett__lliisstt__22(...) from builtins.PyCapsule - | Signature : get_list_2(Example2) -> list + | ggeett__lliisstt__22(...) + | Signature : (Example2) -> list | | Return a C++ list | - | nneeww__iinnssttaannccee(...) from builtins.PyCapsule - | Signature : new_instance() -> Example2 - | - | Return an instance - | - | ppaaiirr__ppaasssstthhrroouugghh(...) from builtins.PyCapsule - | Signature : pair_passthrough(Example2, (bool, str)) -> (str, bool) + | ppaaiirr__ppaasssstthhrroouugghh(...) + | Signature : (Example2, (bool, str)) -> (str, bool) | | Return a pair in reversed order | - | pprriinntt__ddiicctt(...) from builtins.PyCapsule - | Signature : print_dict(Example2, dict) -> None + | pprriinntt__ddiicctt(...) + | Signature : (Example2, dict) -> None | | Print entries of a Python dictionary | - | pprriinntt__ddiicctt__22(...) from builtins.PyCapsule - | Signature : print_dict_2(Example2, dict) -> None + | pprriinntt__ddiicctt__22(...) + | Signature : (Example2, dict) -> None | | Print entries of a C++ dictionary | - | pprriinntt__lliisstt(...) from builtins.PyCapsule - | Signature : print_list(Example2, list) -> None + | pprriinntt__lliisstt(...) + | Signature : (Example2, list) -> None | | Print entries of a Python list | - | pprriinntt__lliisstt__22(...) from builtins.PyCapsule - | Signature : print_list_2(Example2, list) -> None + | pprriinntt__lliisstt__22(...) + | Signature : (Example2, list) -> None | | Print entries of a C++ list | - | tthhrrooww__eexxcceeppttiioonn(...) from builtins.PyCapsule - | Signature : throw_exception(Example2) -> None + | tthhrrooww__eexxcceeppttiioonn(...) + | Signature : (Example2) -> None | | Throw an exception | - | ttuuppllee__ppaasssstthhrroouugghh(...) from builtins.PyCapsule - | Signature : tuple_passthrough(Example2, (bool, str, int32_t)) -> (int32_t, str, bool) + | ttuuppllee__ppaasssstthhrroouugghh(...) + | Signature : (Example2, (bool, str, int32_t)) -> (int32_t, str, bool) | | Return a triple in reversed order | | ---------------------------------------------------------------------- | Data and other attributes defined here: | - | ____iinnssttaannccee__ssiizzee____ = 1 + | ____nneeww____ = + | T.__new__(S, ...) -> a new object with type S, a subtype of T + | + | ____ppyybbiinndd____ = + | + | nneeww__iinnssttaannccee = + | Signature : () -> Example2 + | + | Return an instance Destructing Example2 diff --git a/example/example3.ref b/example/example3.ref index e45c110df..698b5ad6e 100644 --- a/example/example3.ref +++ b/example/example3.ref @@ -1,37 +1,57 @@ Value constructor Value constructor -Value constructor -Copy constructor -Destructor. -Destructor. -Value constructor -Copy constructor -Destructor. -Destructor. -Value constructor -Copy constructor -Destructor. -Destructor. -Value constructor -Copy constructor -Destructor. -Destructor. -Value constructor -Copy constructor -Destructor. -Destructor. -Value constructor -Copy constructor -Destructor. -Destructor. v1 = [1.000000, 2.000000] v2 = [3.000000, -1.000000] +Value constructor +Copy constructor +Destructor. +Destructor. v1+v2 = [4.000000, 1.000000] +Value constructor +Copy constructor +Destructor. +Destructor. v1-v2 = [-2.000000, 3.000000] +Value constructor +Copy constructor +Destructor. +Destructor. v1-8 = [-7.000000, -6.000000] +Value constructor +Copy constructor +Destructor. +Destructor. v1+8 = [9.000000, 10.000000] +Value constructor +Copy constructor +Destructor. +Destructor. v1*8 = [8.000000, 16.000000] +Value constructor +Copy constructor +Destructor. +Destructor. v1/8 = [0.125000, 0.250000] +Value constructor +Copy constructor +Destructor. +Destructor. +8-v1 = [7.000000, 6.000000] +Value constructor +Copy constructor +Destructor. +Destructor. +8+v1 = [9.000000, 10.000000] +Value constructor +Copy constructor +Destructor. +Destructor. +8*v1 = [8.000000, 16.000000] +Value constructor +Copy constructor +Destructor. +Destructor. +8/v1 = [8.000000, 4.000000] (v1+v2)*2 = [8.000000, 2.000000] Destructor. Destructor. diff --git a/example/example4.ref b/example/example4.ref index 09935a96a..1d2dd9b38 100644 --- a/example/example4.ref +++ b/example/example4.ref @@ -1,16 +1,16 @@ -test_function() -test_function(7) -test_function(enum=1) -test_function(enum=2) -Example4::test_function(enum=1) EMyEnumeration.EFirstEntry EMyEnumeration.ESecondEntry EMyEnumeration.EFirstEntry +test_function() False +test_function(7) 3.5 +test_function(enum=1) None +test_function(enum=2) None - + EMode.EFirstMode EMode.EFirstMode +Example4::test_function(enum=1) diff --git a/example/example5.ref b/example/example5.ref index 406112888..51c1b05cb 100644 --- a/example/example5.ref +++ b/example/example5.ref @@ -1,16 +1,14 @@ Polly is a parrot +Polly is a parrot +Molly is a dog Molly is a dog Woof! -Constructing Example5.. -In Example5::callback() -Polly is a parrot -Molly is a dog The following error is expected: Incompatible function arguments. The following argument types are supported: - 1. dog_bark(Dog) -> None + 1. (Dog) -> None Callback function 1 called! False -Callback function 2 called : Hello, True, 5 +Callback function 2 called : Hello, x, True, 5 5 -got callback: 3 4 -Destructing Example5.. +func(43) = 44 +func(43) = 44 diff --git a/example/example6.ref b/example/example6.ref index 8986be6a6..bc369023f 100644 --- a/example/example6.ref +++ b/example/example6.ref @@ -1,18 +1,21 @@ Value constructor: Creating a sequence with 5 entries -Value constructor: Creating a sequence with 5 entries -Copy constructor: Creating a sequence with 5 entries -Freeing a sequence with 5 entries -s = +s = len(s) = 5 s[0], s[3] = 0.000000 0.000000 12.34 in s: False 12.34 in s: True s[0], s[3] = 12.340000 56.779999 +Value constructor: Creating a sequence with 5 entries +Copy constructor: Creating a sequence with 5 entries +Freeing a sequence with 5 entries +Value constructor: Creating a sequence with 5 entries rev[0], rev[1], rev[2], rev[3], rev[4] = 0.000000 56.779999 0.000000 0.000000 12.340000 -12.34000015258789 -0.0 -0.0 -56.779998779296875 -0.0 +0.0 56.7799987793 0.0 0.0 12.3400001526 +0.0 56.7799987793 0.0 0.0 12.3400001526 +True +Value constructor: Creating a sequence with 3 entries +Freeing a sequence with 3 entries +2.0 56.7799987793 2.0 0.0 2.0 +Freeing a sequence with 5 entries Freeing a sequence with 5 entries Freeing a sequence with 5 entries diff --git a/example/example7.ref b/example/example7.ref index 6112cf6a8..75db9633b 100644 --- a/example/example7.ref +++ b/example/example7.ref @@ -8,4 +8,10 @@ Value constructor: Creating a 5x5 matrix [ 0. 0. 0. 0. 0.]] 4.0 5.0 +[[ 1. 2. 3.] + [ 4. 5. 6.]] +Value constructor: Creating a 2x3 matrix +1.0 2.0 3.0 +4.0 5.0 6.0 +Freeing a 2x3 matrix Freeing a 5x5 matrix diff --git a/example/example8.ref b/example/example8.ref new file mode 100644 index 000000000..87577a915 --- /dev/null +++ b/example/example8.ref @@ -0,0 +1,261 @@ +MyObject[1] constructor +Initialized ref from pointer 0x7ff7d9742750 +MyObject[2] constructor +Initialized ref from pointer 0x7ff7d9742150 +Initialized ref from pointer 0x7ff7d9742150 +Destructing ref 0x7ff7d9742150 +MyObject[3] constructor +Initialized ref from pointer 0x7ff7d9741800 +Reference count = 1 +MyObject[1] +Created empty ref +Initialized ref from pointer 0x7ff7d9742750 +Move-assigning ref 0x7ff7d9742750 +Destructing ref 0x0 +Initialized ref from ref 0x7ff7d9742750 +MyObject[1] +Destructing ref 0x7ff7d9742750 +Destructing ref 0x7ff7d9742750 +Created empty ref +Initialized ref from pointer 0x7ff7d9742750 +Move-assigning ref 0x7ff7d9742750 +Destructing ref 0x0 +MyObject[1] +Destructing ref 0x7ff7d9742750 +Created empty ref +Initialized ref from pointer 0x7ff7d9742750 +Move-assigning ref 0x7ff7d9742750 +Destructing ref 0x0 +MyObject[1] +Destructing ref 0x7ff7d9742750 +Reference count = 1 +MyObject[2] +Created empty ref +Initialized ref from pointer 0x7ff7d9742150 +Move-assigning ref 0x7ff7d9742150 +Destructing ref 0x0 +Initialized ref from ref 0x7ff7d9742150 +MyObject[2] +Destructing ref 0x7ff7d9742150 +Destructing ref 0x7ff7d9742150 +Created empty ref +Initialized ref from pointer 0x7ff7d9742150 +Move-assigning ref 0x7ff7d9742150 +Destructing ref 0x0 +MyObject[2] +Destructing ref 0x7ff7d9742150 +Created empty ref +Initialized ref from pointer 0x7ff7d9742150 +Move-assigning ref 0x7ff7d9742150 +Destructing ref 0x0 +MyObject[2] +Destructing ref 0x7ff7d9742150 +Reference count = 1 +MyObject[3] +Created empty ref +Initialized ref from pointer 0x7ff7d9741800 +Move-assigning ref 0x7ff7d9741800 +Destructing ref 0x0 +Initialized ref from ref 0x7ff7d9741800 +MyObject[3] +Destructing ref 0x7ff7d9741800 +Destructing ref 0x7ff7d9741800 +Created empty ref +Initialized ref from pointer 0x7ff7d9741800 +Move-assigning ref 0x7ff7d9741800 +Destructing ref 0x0 +MyObject[3] +Destructing ref 0x7ff7d9741800 +Created empty ref +Initialized ref from pointer 0x7ff7d9741800 +Move-assigning ref 0x7ff7d9741800 +Destructing ref 0x0 +MyObject[3] +Destructing ref 0x7ff7d9741800 +Destructing ref 0x7ff7d9742150 +MyObject[2] destructor +Destructing ref 0x7ff7d9742750 +MyObject[1] destructor +MyObject[4] constructor +Initialized ref from pointer 0x7ff7d9742750 +MyObject[5] constructor +Initialized ref from pointer 0x7ff7d9742150 +Initialized ref from pointer 0x7ff7d9742150 +Destructing ref 0x7ff7d9742150 +MyObject[6] constructor +Initialized ref from pointer 0x7ff7d9741cf0 +Destructing ref 0x7ff7d9741800 +MyObject[3] destructor + +MyObject[4] +Created empty ref +Initialized ref from pointer 0x7ff7d9742750 +Move-assigning ref 0x7ff7d9742750 +Destructing ref 0x0 +Initialized ref from ref 0x7ff7d9742750 +MyObject[4] +Destructing ref 0x7ff7d9742750 +Destructing ref 0x7ff7d9742750 +Created empty ref +Initialized ref from pointer 0x7ff7d9742750 +Move-assigning ref 0x7ff7d9742750 +Destructing ref 0x0 +MyObject[4] +Destructing ref 0x7ff7d9742750 +Created empty ref +Initialized ref from pointer 0x7ff7d9742750 +Move-assigning ref 0x7ff7d9742750 +Destructing ref 0x0 +MyObject[4] +Destructing ref 0x7ff7d9742750 +MyObject[4] +Created empty ref +Initialized ref from pointer 0x7ff7d9742750 +Move-assigning ref 0x7ff7d9742750 +Destructing ref 0x0 +Initialized ref from ref 0x7ff7d9742750 +MyObject[4] +Destructing ref 0x7ff7d9742750 +Destructing ref 0x7ff7d9742750 +Created empty ref +Initialized ref from pointer 0x7ff7d9742750 +Move-assigning ref 0x7ff7d9742750 +Destructing ref 0x0 +MyObject[4] +Destructing ref 0x7ff7d9742750 +Created empty ref +Initialized ref from pointer 0x7ff7d9742750 +Move-assigning ref 0x7ff7d9742750 +Destructing ref 0x0 +MyObject[4] +Destructing ref 0x7ff7d9742750 + +MyObject[5] +Created empty ref +Initialized ref from pointer 0x7ff7d9742150 +Move-assigning ref 0x7ff7d9742150 +Destructing ref 0x0 +Initialized ref from ref 0x7ff7d9742150 +MyObject[5] +Destructing ref 0x7ff7d9742150 +Destructing ref 0x7ff7d9742150 +Created empty ref +Initialized ref from pointer 0x7ff7d9742150 +Move-assigning ref 0x7ff7d9742150 +Destructing ref 0x0 +MyObject[5] +Destructing ref 0x7ff7d9742150 +Created empty ref +Initialized ref from pointer 0x7ff7d9742150 +Move-assigning ref 0x7ff7d9742150 +Destructing ref 0x0 +MyObject[5] +Destructing ref 0x7ff7d9742150 +MyObject[5] +Created empty ref +Initialized ref from pointer 0x7ff7d9742150 +Move-assigning ref 0x7ff7d9742150 +Destructing ref 0x0 +Initialized ref from ref 0x7ff7d9742150 +MyObject[5] +Destructing ref 0x7ff7d9742150 +Destructing ref 0x7ff7d9742150 +Created empty ref +Initialized ref from pointer 0x7ff7d9742150 +Move-assigning ref 0x7ff7d9742150 +Destructing ref 0x0 +MyObject[5] +Destructing ref 0x7ff7d9742150 +Created empty ref +Initialized ref from pointer 0x7ff7d9742150 +Move-assigning ref 0x7ff7d9742150 +Destructing ref 0x0 +MyObject[5] +Destructing ref 0x7ff7d9742150 + +MyObject[6] +Created empty ref +Initialized ref from pointer 0x7ff7d9741cf0 +Move-assigning ref 0x7ff7d9741cf0 +Destructing ref 0x0 +Initialized ref from ref 0x7ff7d9741cf0 +MyObject[6] +Destructing ref 0x7ff7d9741cf0 +Destructing ref 0x7ff7d9741cf0 +Created empty ref +Initialized ref from pointer 0x7ff7d9741cf0 +Move-assigning ref 0x7ff7d9741cf0 +Destructing ref 0x0 +MyObject[6] +Destructing ref 0x7ff7d9741cf0 +Created empty ref +Initialized ref from pointer 0x7ff7d9741cf0 +Move-assigning ref 0x7ff7d9741cf0 +Destructing ref 0x0 +MyObject[6] +Destructing ref 0x7ff7d9741cf0 +MyObject[6] +Created empty ref +Initialized ref from pointer 0x7ff7d9741cf0 +Move-assigning ref 0x7ff7d9741cf0 +Destructing ref 0x0 +Initialized ref from ref 0x7ff7d9741cf0 +MyObject[6] +Destructing ref 0x7ff7d9741cf0 +Destructing ref 0x7ff7d9741cf0 +Created empty ref +Initialized ref from pointer 0x7ff7d9741cf0 +Move-assigning ref 0x7ff7d9741cf0 +Destructing ref 0x0 +MyObject[6] +Destructing ref 0x7ff7d9741cf0 +Created empty ref +Initialized ref from pointer 0x7ff7d9741cf0 +Move-assigning ref 0x7ff7d9741cf0 +Destructing ref 0x0 +MyObject[6] +Destructing ref 0x7ff7d9741cf0 +7 +MyObject[7] constructor +Initialized ref from pointer 0x7ff7d9741800 +MyObject[7] +Destructing ref 0x7ff7d9741800 +MyObject[7] destructor +Created empty ref +MyObject[7] constructor +Initialized ref from pointer 0x7ff7d9741800 +Initialized ref from pointer 0x7ff7d9741800 +Move-assigning ref 0x7ff7d9741800 +Destructing ref 0x0 +Initialized ref from ref 0x7ff7d9741800 +MyObject[7] +Destructing ref 0x7ff7d9741800 +Destructing ref 0x7ff7d9741800 +Destructing ref 0x7ff7d9741800 +MyObject[7] destructor +Created empty ref +MyObject[7] constructor +Initialized ref from pointer 0x7ff7d9741800 +Initialized ref from pointer 0x7ff7d9741800 +Move-assigning ref 0x7ff7d9741800 +Destructing ref 0x0 +MyObject[7] +Destructing ref 0x7ff7d9741800 +Destructing ref 0x7ff7d9741800 +MyObject[7] destructor +Created empty ref +MyObject[7] constructor +Initialized ref from pointer 0x7ff7d9741800 +Initialized ref from pointer 0x7ff7d9741800 +Move-assigning ref 0x7ff7d9741800 +Destructing ref 0x0 +MyObject[7] +Destructing ref 0x7ff7d9741800 +Destructing ref 0x7ff7d9741800 +MyObject[7] destructor +Destructing ref 0x7ff7d9741cf0 +MyObject[6] destructor +Destructing ref 0x7ff7d9742150 +MyObject[5] destructor +Destructing ref 0x7ff7d9742750 +MyObject[4] destructor diff --git a/example/example9.ref b/example/example9.ref new file mode 100644 index 000000000..c498077d7 --- /dev/null +++ b/example/example9.ref @@ -0,0 +1,21 @@ +example +example.submodule +submodule_func() +A constructor +A constructor +B constructor +A[1] +A[1] +A[2] +A[2] +A constructor +A destructor +A constructor +A destructor +A[42] +A[42] +A[43] +A[43] +B destructor +A destructor +A destructor