Lean icon indicating copy to clipboard operation
Lean copied to clipboard

Python Enum Functionality in LEAN

Open ArthurAsenheimer opened this issue 10 months ago • 0 comments

Expected Behavior

LEAN's enum objects behave like real enums.

Actual Behavior

Currently, all of LEAN's enums behave like integers in Python. This causes incorrect results with isinstance checks and usage of the is operator.

Potential Solution

Upgrading to pythonnet 3.0.0 or higher should address these limitations according to this discussion.

Reproducing the Problem

Take a look at the jupyter-notebook here.

System Information

QC Cloud

Checklist

  • [x] I have completely filled out this template
  • [x] I have confirmed that this issue exists on the current master branch
  • [x] I have confirmed that this is not a duplicate issue by searching issues
  • [x] I have provided detailed steps to reproduce the issue

ArthurAsenheimer avatar Mar 13 '25 19:03 ArthurAsenheimer