How realistic are plans to ban new gas and diesel cars?

Ban the sale of gasoline and diesel cars by a deadline—2040, 2030, even 2025. More and more governments are proposing just that.