[Tutor] really basic py/regex

Peter Otten __peter__ at web.de
Sat Mar 31 05:03:08 EDT 2018


Steven D'Aprano wrote:

> blacklist = set(['THE'])  # in Python 3, use {'THE'}

Note that set literals were backported to Python 2.7: 

$ python
Python 2.7.6 (default, Nov 23 2017, 15:49:48) 
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> {"foo"}
set(['foo'])




More information about the Tutor mailing list