Description
#19100 added support for importing future annotations for TC001, TC002, TC003, UP037, and RUF013 as a proof of concept, but other rules could also be affected. In particular,
- non-pep585-annotation (UP006)
- non-pep604-annotation-union (UP007)
- non-pep604-annotation-optional (UP045)
all currently rely on future-rewritable-type-annotation (FA100) for similar behavior, but they could just add the import themselves. This would likely mean deprecating FA100 eventually.
Similarly, runtime-import-in-type-checking-block (TC004) uses much of the same infrastructure as TC001-003. Adding a future import could be another option instead of Action::Quote
in its implementation (the whole Action
enum can likely be replaced by the new TypingReference
enum).
runtime-string-union (TC010) could also offer a fix by unquoting the flagged annotation and adding the future import.
Status
- UP006
- UP007
- UP045
- TC004
- TC010