[Python-Dev] ACCEPTED: PEP 285

Martin v. Loewis martin at v.loewis.de
Thu Apr 4 13:47:07 EST 2002


Neal Norwitz <neal at metaslash.com> writes:

> 	def test(a):
> 	    if a is True: print 'True'
> 	    if a == False: print 'False'
> 
> generates these warnings:
> 	test.py:2: Should not assign to True, it is (or will be) a builtin
> 	test.py:3: Should not assign to False, it is (or will be) a builtin

While Gustavo suggests to let pass 'a is True', I recommend to give a
warning for this - people who want to see whether something is True
should write 'True is a'.

Regards,
Martin






More information about the Python-list mailing list