pytha Element Handles - pytha-3d-cad/pytha-lua-api GitHub Wiki
From the perspective of the Lua api, all elements in PYTHA are referred to by element handles.
All functions in the pytha api that create an element (like create_block) return an element handle for the new part (or group or other element). And all modification functions take an element handle or a table of element handles as their parameter (in most instances, an element handle or a table of element handles can be supplied interchangeably).
When the underlying element of an element handle is deleted, e.g. pytha.delete_element(), you might still have orphaned handles to the deleted element. But those are not very useful any more.
To determine the type of element referenced by an element handle, use get_element_type.