You can use neovim to get that working
(although I’ve switched to using ruff instead of black these days)