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

Method.caniuse: Many ways to indicate failing caniuse check #290

Open
fohrloop opened this issue May 25, 2024 · 0 comments
Open

Method.caniuse: Many ways to indicate failing caniuse check #290

fohrloop opened this issue May 25, 2024 · 0 comments
Labels
Type: Enhancement Enhancements that are not new features

Comments

@fohrloop
Copy link
Owner

Currently, when subclassing Method, if the caniuse() check fails, the subclass could either.

  • Return False (means unsuitable) or a string (means unsuitable and tell a reason for it)
  • Raise an Exception

Should there be only one way to indicate that the caniuse check fails? Perhaps, change the wording from

        Returns
        -------
        result: bool | None | str
            ``True`` means suitable, ``None`` means uncertain, ``False`` means
            unsuitable and  a string means unsuitable and tells the reason for
            it.

        Raises
        ------
        Exception
            If the Method may not be used, may raise an Exception.

to

        Returns
        -------
        result: bool | None | str
            ``True`` means suitable, ``None`` means uncertain, ``False`` means
            unsuitable and  a string means unsuitable and tells the reason for
            it.

        any exception raised is interpreted as a failed caniuse check, but when subclassing, it is preferable to use a return value rather than raise an exception.
@fohrloop fohrloop added the Type: Enhancement Enhancements that are not new features label May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Enhancements that are not new features
Projects
None yet
Development

No branches or pull requests

1 participant