[Tutor] really basic py/regex

Steven D'Aprano steve at pearwood.info
Sat Mar 31 06:04:46 EDT 2018


On Sat, Mar 31, 2018 at 11:03:08AM +0200, Peter Otten wrote:
> Steven D'Aprano wrote:
> 
> > blacklist = set(['THE'])  # in Python 3, use {'THE'}
> 
> Note that set literals were backported to Python 2.7: 

Doh! Thanks for the reminder.

When I'm using Python 2.7, I always try to 
use syntax that works back to 2.4 on account of that being the system 
Python on my system. So I forget that 2.7 has certain features like set 
literals.


-- 
Steve


More information about the Tutor mailing list