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

Consistent BitEnum Naming #1778

Open
1 task done
Le0Developer opened this issue Dec 7, 2023 · 1 comment
Open
1 task done

Consistent BitEnum Naming #1778

Le0Developer opened this issue Dec 7, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Le0Developer
Copy link
Contributor

Summary

Currently not all bit-enums are created equal.
The following flags should be pluralized:

  • ActivityFlag
  • ChannelFlag
  • GuildSystemChannelFlag
  • MessageFlag
  • UserFlag

Why is this needed?

Consistency.

Ideal implementation

Add an s.

Checklist

  • I have searched the issue tracker and have made sure it's not a duplicate. If it is a follow up of another issue, I have specified it.
@Le0Developer Le0Developer added the enhancement New feature or request label Dec 7, 2023
@Le0Developer
Copy link
Contributor Author

Deprecation will be a bit tricky but can be done with a module level __getattr__.

Example:

_deprecated = {"ActivityFlag": ActivityFlags, ...}
def __getattr__(name: str) -> typing.Any:
    if name in _deprecated:
        do_deprecation_warning()
        return _deprecated[name]
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant