mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Update the code to better reflect recommended style:
Use != instead of <> since <> is documented as "obsolescent". Use "is" and "is not" when comparing with None or type objects.
This commit is contained in:
parent
c140131995
commit
8152d32375
36 changed files with 101 additions and 99 deletions
|
@ -95,7 +95,7 @@ class Packer:
|
|||
self.pack_uint(0)
|
||||
|
||||
def pack_farray(self, n, list, pack_item):
|
||||
if len(list) <> n:
|
||||
if len(list) != n:
|
||||
raise ValueError, 'wrong array size'
|
||||
for item in list:
|
||||
pack_item(item)
|
||||
|
@ -204,7 +204,7 @@ class Unpacker:
|
|||
while 1:
|
||||
x = self.unpack_uint()
|
||||
if x == 0: break
|
||||
if x <> 1:
|
||||
if x != 1:
|
||||
raise ConversionError, '0 or 1 expected, got ' + `x`
|
||||
item = unpack_item()
|
||||
list.append(item)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue