bpo-32677: Add .isascii() to str, bytes and bytearray by methane · Pull Request #5342 · python/cpython (original) (raw)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to test larger code points as well:
self.assertFalse("\xe9".isascii())
self.assertFalse("\u20ac".isascii())
self.assertFalse("\U0010ffff".isascii())
My 3 favorite code points to test Latin1, BMP and non-BMP :-)
(only these tests, i don't think that it's useful to check for variant with spaces before/after)