This PR makes ClientT covariant. This fixes a couple of typehinting issues I noticed, and... well, it makes sense for it to be covariant anyways, considering what it's meant for.
Changes
See description.
Related Issues
Test Scenarios
import interactions as ipy
from interactions.ext import prefixed_commands as prefixed
class MyBot(ipy.Client):
pass
class MyContext(prefixed.PrefixedContext[MyBot]):
pass
@prefixed.prefixed_command()
async def test(ctx: MyContext):
await ctx.reply("Hi!")
bot = MyBot(...)
prefixed.setup(bot, prefixed_context=MyContext) # here
Python Compatibility
[x] I've ensured my code works on Python 3.10.x
[ ] I've ensured my code works on Python 3.11.x
Checklist
[x] I've run the pre-commit code linter over all edited files
[x] I've tested my changes on supported Python versions
[ ] I've added tests for my code, if applicable
[ ] I've updated / added documentation, where applicable
Pull Request Type
Description
This PR makes
ClientT
covariant. This fixes a couple of typehinting issues I noticed, and... well, it makes sense for it to be covariant anyways, considering what it's meant for.Changes
See description.
Related Issues
Test Scenarios
Python Compatibility
3.10.x
3.11.x
Checklist
pre-commit
code linter over all edited files