Using Extends to hold a handle

I am writing a library for the Raspberry Pi with Xojo. My intent is to make the syntax the same (or very similar) as Python.

pi = pigpio.pi()
pi.set_mode(18, pigpio.OUTPUT)

How do I make the variable pi accept a handle value from the module pigpio and then use the variable as a handle value?

What I am doing now is

pigpio.Handle = pigpio.pi()
Call pigpio.set_mode(pigpio.Handle, 18, pigpio.OUTPUT)

How to I convert the module name pigpio to pi, and then have pi referenced as the handle in Xojo? I tried to set up the pigpio library as a class, but classes don’t extend.

help?

classes can be extended and can be extended in a module that contains them
I do this all the time

whats “pi” in this case ?
that almost looks like a factory function in pigpio that returns a “pi”

Ok, thank you. I’ll look into it some more.

Its just a local method used to create a handle and return the integer value

Hmmm… just thinking about this a little more. I wonder if this would work as a Generic Object? I am going to play with this idea a little bit.

Edit: Just digging into this some more, pi is a variable that holds the object and the memory address.

Using a generic object works well also.

Thanks a bunch Norman!