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

Strict type checking on mypy doesn't work with Pycord #2504

Open
3 tasks done
hwittenborn opened this issue Jul 20, 2024 · 0 comments
Open
3 tasks done

Strict type checking on mypy doesn't work with Pycord #2504

hwittenborn opened this issue Jul 20, 2024 · 0 comments
Labels
unconfirmed bug A bug report that needs triaging

Comments

@hwittenborn
Copy link

Summary

Using mypy --strict with Pycord seems to cause severe type checking issues

Reproduction Steps

  1. Create a virtual environment
  2. Run pip install mypy py-cord
  3. Create a file named main.py, with the following content:
import discord
bot = discord.Bot()
  1. Run mypy main.py, and see no errors:
Success: no issues found in 1 source file
  1. Run mypy --strict main.py, and see mypy start to freak out:
main.py:2: error: Call to untyped function "Bot" in typed context  [no-untyped-call]

Minimal Reproducible Code

No response

Expected Results

When --strict is used, no errors should be thrown.

Actual Results

When --strict is used, unclear errors are thrown.

Intents

N/A

System Information

  • Python v3.12.3-final
  • py-cord v2.6.None-final
  • aiohttp v3.9.5
  • system info: Linux 6.8.0-38-generic Add MessageCommand compatibility #38-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 7 15:25:01 UTC 2024

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

I'm not positive if it's related, but just running mypy -p discord from within the same virtual environment is showing

@hwittenborn hwittenborn added the unconfirmed bug A bug report that needs triaging label Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unconfirmed bug A bug report that needs triaging
Projects
None yet
Development

No branches or pull requests

1 participant