python classes

Skip to first unread message

Peihong Ke

Jul 26, 2023, 9:43:17 AM7/26/23

Dear xlSlim,


Can I check with you if you have some framework in xlSlim to deal with class/objects and their associated functions calls  (either instance or static functions) please? Or the users must come up with one themselves?


For example, if I have a class A which has ten methods. What is the best way to call these functions in xlSlim given an object of A?




Classification: Internal - ADIA Only

PRIVATE & CONFIDENTIAL COMMUNICATION: This email is from the Abu Dhabi Investment Authority (ADIA). This email and its attachments (if any) are confidential and private business communication and are intended only for the named addressees. If you received this email in error, please notify the sender by reply email and promptly delete the original email from your system. The unauthorised use, disclosure or copying of this email, or any part of it, is strictly prohibited.

While ADIA takes care to protect its systems from viruses, it cannot guarantee that this message (including attachments) is free of any virus or other harmful matter, and accepts no responsibility for any loss or damage resulting from the recipient receiving, opening or using it, or for any damage or liability that may be caused by or result from the use of email or internet communications or the reliance thereon.

ADIA does not enter into contracts or undertakings, or provide binding assurances, by email.

xlSlim Dev

Jul 26, 2023, 3:41:14 PM7/26/23
to xlSlim Support

Classes are automatically cached when returned from functions and the cache handle can then be passed into other functions. This is described in this section of the documentation:

Since that guide was written I have added the GetAttr() utility function which is useful to conveniently access attributes of cached objects without having to write any Python functions: Also you can now create classes directly in Excel - each class is automatically registered as a function.

The Equity Option pricing example has a good overview of creating classes and passing them around:

This earlier conversation has an example showing a  shared resource object being created and then passed to other functions:

All the best,
Reply all
Reply to author
0 new messages