[issue21540] PEP 8 should recommend "is not" and "not in"

2014-05-20 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21540] PEP 8 should recommend "is not" and "not in"

2014-05-20 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Agreed!  I'll update the PEP.  Thanks.

--
assignee:  -> barry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21540] PEP 8 should recommend "is not" and "not in"

2014-05-20 Thread Ian Cordasco

Changes by Ian Cordasco :


--
nosy: +icordasc

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21540] PEP 8 should recommend "is not" and "not in"

2014-05-20 Thread Steven Myint

Changes by Steven Myint :


--
nosy: +myint

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21540] PEP 8 should recommend "is not" and "not in"

2014-05-19 Thread Florent Xicluna

Changes by Florent Xicluna :


--
assignee: docs@python -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21540] PEP 8 should recommend "is not" and "not in"

2014-05-19 Thread Florent Xicluna

New submission from Florent Xicluna:

Python accepts both syntaxes:

if not item in some_list and not item is None:
return item

and

if item not in some_list and item is not None:
return item


In the first form, you identify 5 operators: "not", "in", "and", "not" and "in"
In the second form, you find only 3 operators: "not in", "and", "is not"


Of course CPython does internal optimization, and it compiles both expressions 
to the same bytecode.

However the second form is more readable and less error-prone. It is plain 
English.

I propose to add such advice to the section "Programming Recommendations" of 
PEP 8.

--
assignee: docs@python
components: Documentation
messages: 218837
nosy: barry, docs@python, flox, ncoghlan
priority: normal
severity: normal
status: open
title: PEP 8 should recommend "is not" and "not in"
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com