From Pep #270.