Mercurial > pytave
changeset 427:750a86973625
Update doctests for display changes
The output of display was recently improved by commit
24546b7021db2ab2553357f691450144c6c5ab50 but the doctests were
not updated.
* @pyobject/dummy.m, @pyobject/cell.m, @pyobject/display.m: update doctests.
* pyargs.m: update doctests.
author | Colin Macdonald <cbm@m.fsf.org> |
---|---|
date | Wed, 25 Oct 2017 13:16:53 -0700 |
parents | 8a26a4e649ba |
children | 3af3665348a1 |
files | @pyobject/cell.m @pyobject/display.m @pyobject/dummy.m pyargs.m |
diffstat | 4 files changed, 20 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/@pyobject/cell.m Wed Feb 21 16:12:39 2018 -0800 +++ b/@pyobject/cell.m Wed Oct 25 13:16:53 2017 -0700 @@ -28,7 +28,7 @@ ## @example ## @group ## L = pyeval ("[10.0, 20.0, 'hello']") -## @result{} L = [pyobject ...] +## @result{} L = [Python object of type list] ## ## [10.0, 20.0, 'hello'] ## @end group @@ -37,12 +37,14 @@ ## However, we can convert the list to a cell array: ## @example ## @group +## @c TODO: display of cell array in flux: savannah.gnu.org/bugs/?50756 +## @c doctest: +XFAIL ## C = cell (L) ## @result{} C = ## @{ ## [1,1] = 10 ## [1,2] = 20 -## = [pyobject ...] +## [1,3] = [Python object of type str] ## ## hello ## @} @@ -52,13 +54,15 @@ ## The conversion is not recursive, in the following sense: ## @example ## @group +## @c TODO: display of cell array in flux: savannah.gnu.org/bugs/?50756 +## @c doctest: +XFAIL ## L = pyeval ("[10.0, 20.0, [33.0, 44.0], 50.0]"); ## C = cell (L) ## @result{} C = ## @{ ## [1,1] = 10 ## [1,2] = 20 -## = [pyobject ...] +## [1,3] = [Python object of type list] ## ## [33.0, 44.0] ##
--- a/@pyobject/display.m Wed Feb 21 16:12:39 2018 -0800 +++ b/@pyobject/display.m Wed Oct 25 13:16:53 2017 -0700 @@ -26,7 +26,7 @@ ## @group ## pyexec ("import sys") ## sysmodule = pyeval ("sys") -## @result{} sysmodule = [pyobject ...] +## @result{} sysmodule = [Python object of type module] ## ## <module 'sys' (built-in)> ##
--- a/@pyobject/dummy.m Wed Feb 21 16:12:39 2018 -0800 +++ b/@pyobject/dummy.m Wed Oct 25 13:16:53 2017 -0700 @@ -34,7 +34,7 @@ ## @example ## @group ## g = pyobject (int32 (6)) -## @result{} g = [pyobject ...] +## @result{} g = [Python object of type int] ## ## 6 ## @@ -67,7 +67,7 @@ ## @group ## pyexec ("d = dict(two=2)") ## x = pyeval ("d") -## @result{} x = [pyobject ...] +## @result{} x = [Python object of type dict] ## @{'two': 2@} ## ## # oops, overwrote d in Python: @@ -75,7 +75,7 @@ ## ## # but have no fear, we still have a reference to it: ## x -## @result{} x = [pyobject ...] +## @result{} x = [Python object of type dict] ## @{'two': 2@} ## @end group ## @end example @@ -91,7 +91,7 @@ ## @example ## @group ## x -## @result{} x = [pyobject ...] +## @result{} x = [Python object of type dict] ## @{@} ## @end group ## @end example @@ -103,7 +103,7 @@ ## @group ## pyexec ("import sys") ## sysmodule = pyeval ("sys") -## @result{} sysmodule = [pyobject ...] +## @result{} sysmodule = [Python object of type module] ## <module 'sys' (built-in)> ## @end group ## @end example @@ -121,7 +121,7 @@ ## @example ## @group ## L = pyeval ("[42.0, 'hello', sys]") -## @result{} L = [pyobject ...] +## @result{} L = [Python object of type list] ## [42.0, 'hello', <module 'sys' (built-in)>] ## @end group ## @end example @@ -136,13 +136,15 @@ ## or if needed, the list can be converted to a cell array: ## @example ## @group +## @c TODO: display of cell array in flux: savannah.gnu.org/bugs/?50756 +## @c doctest: +XFAIL ## cell (L) ## @result{} ans = ## @{ ## [1,1] = 42 -## = [pyobject ...] +## [1,2] = [Python object of type str] ## hello -## = [pyobject ...] +## [1,3] = [Python object of type module] ## <module 'sys' (built-in)> ## @} ## @end group
--- a/pyargs.m Wed Feb 21 16:12:39 2018 -0800 +++ b/pyargs.m Wed Oct 25 13:16:53 2017 -0700 @@ -30,7 +30,7 @@ ## @example ## @group ## py.dict (pyargs ("one", 1, "two", 2)) -## @result{} [pyobject ...] +## @result{} [Python object of type dict] ## @{...@} ## sort (cellfun (@@char, cell (py.list (ans.keys ())), "uniformoutput", false)) ## @result{} @@ -48,7 +48,7 @@ ## x = py.list (num2cell (int32 ([1, 2, 3]))); ## x.sort (pyargs ("reverse", true)); ## x -## @result{} x = [pyobject ...] +## @result{} x = [Python object of type list] ## [3, 2, 1] ## @end group ## @end example