Skip to content
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

replace Cyan's xEnum by Python's enum #696

Merged
merged 1 commit into from Aug 14, 2020
Merged

replace Cyan's xEnum by Python's enum #696

merged 1 commit into from Aug 14, 2020

Conversation

ghost
Copy link

@ghost ghost commented Aug 10, 2020

No description provided.

@@ -86,9 +86,9 @@
IgnoreTime = 120
PageTurnInterval = 120

TimerID = xEnum.Enum("IgnoreFinished = 10, TurnPage")
TimerID = enum.IntEnum("TimerID", {"IgnoreFinished": 10, "TurnPage": 11})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe start=10 instead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered it but I thought it could be too easily read over as "start=0" since that occurs in some places, though indeed it would be more consistent...

@@ -132,7 +132,9 @@
gearStartingDown = False
weightEngageDisabled = False

TimerID = xEnum.Enum("UpElevatorSwitch, DownElevatorSwitch")
class TimerID(enum.IntEnum):
UpElevatorSwitch = 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will be more Pythonic in cases where we don't need to change the start value:

Suggested change
UpElevatorSwitch = 1
UpElevatorSwitch = enum.auto()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed for all of the ones that start at 1!

Would be nice if there was a way to have auto but specify the starting value... Maybe I should take it up to python-dev ;)

@Hoikas Hoikas merged commit 89ccb8c into H-uru:master Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant