Skip to content

Conversation

Copy link

Copilot AI commented Jan 28, 2026

The UnknownEnumMixin._missing_ method overrides StrEnum._missing_ but lacked explicit acknowledgment, causing type checker ambiguity about the intentional override in the mixin pattern.

Changes

  • Added # type: ignore[override] to _missing_ method signature
  • Enhanced docstring to document the intentional override of StrEnum._missing_
  • Removed unused Any import

Context

Mixin classes can't use @override decorator 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.

class UnknownEnumMixin:
    @classmethod
    def _missing_(cls, value: object) -> Self:  # type: ignore[override]
        """Return `UNKNOWN` and log unrecognized values.

        Intentionally overrides `StrEnum._missing_` to provide UNKNOWN fallback.
        """
        # ... implementation

💡 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.

Copilot AI and others added 2 commits January 28, 2026 09:05
… override

Co-authored-by: iMicknl <1424596+iMicknl@users.noreply.github.com>
Co-authored-by: iMicknl <1424596+iMicknl@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 28, 2026

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:

  • astral.sh
    • Triggering command: /usr/bin/curl curl -LsSf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Update enum structure based on feedback Explicitly acknowledge _missing_ override in UnknownEnumMixin Jan 28, 2026
Copilot AI requested a review from iMicknl January 28, 2026 09:08
@iMicknl iMicknl marked this pull request as ready for review January 29, 2026 09:25
@iMicknl iMicknl requested a review from tetienne as a code owner January 29, 2026 09:25
Copilot AI review requested due to automatic review settings January 29, 2026 09:25
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 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 Any import 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>
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