Como manter apenas os objetos Certian Python

rm(list=setdiff(ls(), "x"))
Lovely Lion