-
-
Notifications
You must be signed in to change notification settings - Fork 531
Description
Mypy supports splitting types by Python versions by interpreting if sys.version_info ... checks. But we have no mechanism to conditionally split types by Django version. This has lead to lots of small issues where Django’s API has changed and we cannot have correct types for all versions we attempt to support.
To counter this problem, @sobolevn suggested doing releases per Django version, where we only officially support the latest version: #1095 (comment) . This is going to be the easiest for the time being, but if we can find a mechanism to split types by Django version, we could backtrack on this decision.
Related Mypy issue: python/typing#693
@ngnpope investigated a possibility with literal numerical types: #1160 (comment) . If we could supply the literal numerical type for the Django version from the MYpy plugin, then perhaps Mypy could use the type of that for conditions in stub files.