-
Notifications
You must be signed in to change notification settings - Fork 34
Explicitly acknowledge _missing_ override in UnknownEnumMixin #1929
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
base: v2/enums
Are you sure you want to change the base?
Conversation
… override Co-authored-by: iMicknl <1424596+iMicknl@users.noreply.github.com>
Co-authored-by: iMicknl <1424596+iMicknl@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this 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 improves type checker clarity for the UnknownEnumMixin._missing_ method by explicitly acknowledging its intentional override of the base enum _missing_ method. The change addresses type checker ambiguity in mixin patterns where the @override decorator cannot be used.
Changes:
- Added
# type: ignore[override]annotation to_missing_method to silence type checker warnings about override in mixin pattern - Enhanced docstring to document the intentional override behavior
- Removed unused
Anyimport from typing module
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
The
UnknownEnumMixin._missing_method overridesStrEnum._missing_but lacked explicit acknowledgment, causing type checker ambiguity about the intentional override in the mixin pattern.Changes
# type: ignore[override]to_missing_method signatureStrEnum._missing_AnyimportContext
Mixin classes can't use
@overridedecorator since they don't directly inherit from the classes they'll be mixed with. The type ignore annotation is the standard pattern for acknowledging overrides in mixins.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.