Mercurial > pytave
comparison @pyobject/display.m @ 362:b0677c492655
Overhaul Python object storage and wrapping in pyobject
* oct-py-util.cc, oct-py-util.h (pytave::py_objstore_del,
pytave::py_objstore_get, pytave::py_objstore_put, pytave::pyobject_wrap_object,
pytave::pyobject_unwrap_object): New functions.
(pytave::get_object_from_python): Use pyobject_unwrap_object.
* octave_to_python.cc (pytave::octvalue_to_pyobj): Use pyobject_unwrap_object.
* python_to_octave.cc (pytave::pyobj_to_octvalue): Use pyobject_wrap_object.
(pytave::pyobj_to_oct_pyobject): Delete.
* __py_struct_from_dict__.cc (F__py_objstore_del__, F__py_objstore_get__,
F__py_objstore_put__): New functions.
* @pyobject/pyobject.m (pyobject.m_id): Rename from id.
(pyobject.pyobject): Use __py_objstore_put__, simplify conditional logic.
(pyobject.delete): Use __py_objstore_del__. (pyobject.id): Rename from getid.
* @pyobject/display.m: Use pyobject.id method name, format as hex.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Thu, 25 Aug 2016 09:51:58 -0700 |
parents | 3bf799e80ca5 |
children | c90d70aec553 24546b7021db |
comparison
equal
deleted
inserted
replaced
361:07c1b457cb6b | 362:b0677c492655 |
---|---|
39 | 39 |
40 function display (x) | 40 function display (x) |
41 | 41 |
42 loose = ! __compactformat__ (); | 42 loose = ! __compactformat__ (); |
43 | 43 |
44 printf ("%s = [pyobject %s]\n", inputname (1), getid (x)); | 44 printf ("%s = [pyobject 0x%x]\n", inputname (1), id (x)); |
45 s = char (x); | 45 s = char (x); |
46 s = make_indented (s); | 46 s = make_indented (s); |
47 if (loose), printf ("\n"); endif | 47 if (loose), printf ("\n"); endif |
48 disp (s) | 48 disp (s) |
49 if (loose), printf ("\n"); endif | 49 if (loose), printf ("\n"); endif |