`all_ascii(L)` is a function that accepts a list of strings L, and
returns True if all of those strings contain only ASCII chars, False
otherwise.

What's the fastest way to implement `all_ascii(L)`?

My ideas so far are:

1. Match against a regexp with a character range: `[ -~]`
2. Use s.decode('ascii')
3. `return all(31< ord(c) < 127 for s in L for c in s)`

Any other ideas?  Which one do you think will be fastest?

Will reply with final benchmarks and implementations if there's any interest.

Thanks, D
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to