Skip to content

Conversation

@fkuefler
Copy link

@fkuefler fkuefler commented Jan 9, 2026

Overview

This PR fixes a typo where OrderType and AssetType were incorrectly inheriting from the enumerate function. It replaces this with proper (str, Enum) inheritance to satisfy type checkers while maintaining backward compatibility.

Description

Inheriting from enumerate (???) caused static type checkers like Pylance to incorrectly flag class attributes as strings rather than instances of their class. To fix this I used (str, Enum) inheritance with a str override so that members compare equal to raw strings and existing code doesn't break.

Types of changes

  • Refactor/enhancement
  • Bug fix/behavior correction
  • New feature
  • Breaking change
  • Other, additional

Status

  • Prefix PR title with [WIP] if necessary (changes not yet made).
  • Add tests to cover changes as needed.
  • Update documentation/changelog as needed.
  • Verify all tests run correctly in CI and pass.
  • Ready for review/merge.

Note

Corrects enum definitions to satisfy type checkers and maintain string compatibility.

  • Replace enumerate inheritance with str, Enum for OrderType and AssetType
  • Add __str__ methods returning .value for both enums
  • Import Enum and update references where default enum values are used

Written by Cursor Bugbot for commit 55fe98b. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings January 9, 2026 05:52
@fkuefler fkuefler requested a review from a team as a code owner January 9, 2026 05:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a typo where OrderType and AssetType classes were incorrectly inheriting from the built-in enumerate function instead of the Enum class. The fix replaces this with proper (str, Enum) inheritance and adds __str__() overrides to maintain backward compatibility with existing code that expects enum values to serialize as strings.

  • Fixed incorrect inheritance from enumerate function to proper (str, Enum) pattern
  • Added __str__() method override to both enums to return their string values
  • Imported the Enum class from the enum module

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@LBruyne
Copy link

LBruyne commented Jan 17, 2026

Why dont push and merge this PR as soon as possible? This is very important!

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.

2 participants