Use object class to hold partially converted python objects.
Using object class to hold converted object automatically deallocates
object if an exception is thrown or scope is left before constructing
complete Python object.
Additionally added method object::release() that allows to release
ownership of python object without decreasing its reference count.
diff --git a/docs/reference.rst b/docs/reference.rst
index bf7a8e2..2bc62b5 100644
--- a/docs/reference.rst
+++ b/docs/reference.rst
@@ -59,7 +59,7 @@
Creates a :class:`handle` from the given raw Python object pointer.
-.. function:: PyObject * handle::ptr()
+.. function:: PyObject * handle::ptr() const
Return the ``PyObject *`` underlying a :class:`handle`.
@@ -167,6 +167,12 @@
Move constructor; steals the object from ``other`` and preserves its
reference count.
+.. function:: PyObject* object::release()
+
+ Release ownership of underlying ``PyObject *``. Returns raw Python object
+ pointer without decreasing its reference count and resets handle to
+ ``nullptr``-valued pointer.
+
.. function:: object::~object()
Constructor, which automatically calls :func:`handle::dec_ref()`.