Recently, Mary Nichols, the chair of California’s Air Resources Board, speculated that the state could ban sales of vehicles powered by internal combustion engines as early as a decade from now. China, France and the United Kingdom already have promised to do so by the middle of this century. Nichols said that Governor Jerry Brown asked her “Why haven’t we done something already?” and that he “has certainly indicated an interest in why China can do this and not California.”

After Nichols’ statement, Assembly member Phil Ting, representing California’s District 19, announced plans to introduce a bill in the January 2018 legislative session that would ban the sale of cars and trucks with internal combustion engines by 2040.

It’s no surprise that the timeline is so far into the future: A ban on internal combustion engines would be terrible policy today and is unlikely to be wise policy anytime in the foreseeable future. If the ban goes into effect before electric vehicles are price-competitive with vehicles powered by internal combustion engines, low-income households that cannot afford the more expensive electric vehicles will be harmed. If it goes into effect after electric vehicles are comparable in price and driving ranges, people may well voluntarily trade in their gas-guzzlers for vehicles producing no tailpipe emissions.

As the ubiquity of stickers warning consumers of “chemicals known to the State of California to cause cancer” shows, California’s regulations have effects far beyond its borders. In 2012, for instance, the California Air Resources Board promulgated rules mandating that by 2025, 15 percent of all new vehicles sold in the state must have “zero-emissions.” That regulation now has been adopted by 13 additional states. Because automakers want to make vehicles that can be sold anywhere, California’s regulations are, in practice, forced on the entire country.

If California were to ban internal combustion engines entirely, people living in the eastern half of the United States would be worse off. That is because electric vehicles are only as green as the electricity grid from which they draw their power.

California relies heavily on natural gas and renewables such as hydro, solar and wind, and nuclear energy to generate electric power, and so the state’s grid generally is clean enough that putting more electric vehicles on the highways may reduce emissions overall. However, California is the exception, not the rule. Many states rely on coal to generate electricity, resulting in grids that are far dirtier than California’s. If every gasoline or diesel-powered car in the nation suddenly was replaced by an electric one, the result could be more emissions, not less.

We don’t know how the grid will look in 2040, nor do we know how transportation technologies will change. The cost of renewable energy may continue to decline and reliance on it become more widespread. It’s even possible that by 2040 ride-sharing services combines with autonomous vehicles will have made mass car ownership obsolete.

In any case, policymakers must take into account the full carbon footprint of electric vehicles before concluding that they will save the environment. Just because their drivers don’t have to fill up at gas stations doesn’t mean that their operation is emissions free. Where the electricity needed to charge and recharge their batteries comes from matters a great deal.

Even were Assembly member Ting’s bill to pass, it is likely to be delayed or revised years later when the economic and environmental costs are more imminent. The regulatory measures proposed in California and elsewhere allow their supporters to claim political benefits by appearing to care about the environment without having to bear any of the costs that may be incurred long after they are out of office.