-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws-ec2: ec2.AmazonLinux2Kernel is not an enum in Python #26305
Comments
I think it's because of their different internal implementation. AmazonLinuxGeneration is enum while AmazonLinux2Kernel is actually a class(object in python) and you can't compare object with '==' in python. |
Agreed. Some degree of standardization probably needs to happen here. We should ask: does it make sense to compare two I think most Python developers would expect things that look like enumerations to be enumerations. As a workaround, for now, I'm using the |
And another thought: if these shouldn't be an enumeration (or if that's breaking), would it make sense to implement the |
Describe the bug
In Python, AmazonLinux2Kernel is not an enumeration (not an enum.Enum) in CDK -
vs
We can see that the class of this is not an enumeration, like other enumerations in the aws-ec2 code:
This inconsistency means it is difficult to compare certain objects in python.
Expected Behavior
I expected an enumeration to be an enumeration - the comparison above should have passed.
Current Behavior
The enumeration was not an enumeration, and the comparison above failed.
Reproduction Steps
The code above should suffice.
Possible Solution
Make these enumerations, enumerations.
Additional Information/Context
No response
CDK CLI Version
2.84.0
Framework Version
No response
Node.js Version
18.16.0
OS
MacOS
Language
Python
Language Version
3.9.6
Other information
No response
The text was updated successfully, but these errors were encountered: