stop using 'as' as an identifier: as with 'with', 'as' has become a reserved word in python 2.6

This commit is contained in:
Brian Warner 2008-10-02 17:27:49 -07:00
parent 034364c80b
commit 9c505e49c2
2 changed files with 7 additions and 8 deletions

View File

@ -76,11 +76,10 @@ class PeerTracker:
self._storageserver = storage_server # to an RIStorageServer
self.buckets = {} # k: shareid, v: IRemoteBucketWriter
self.sharesize = sharesize
as = storage.allocated_size(sharesize,
num_segments,
num_share_hashes,
EXTENSION_SIZE)
self.allocated_size = as
self.allocated_size = storage.allocated_size(sharesize,
num_segments,
num_share_hashes,
EXTENSION_SIZE)
self.blocksize = blocksize
self.num_segments = num_segments

View File

@ -18,9 +18,9 @@ class T(unittest.TestCase):
assert base62.num_octets_that_encode_to_this_many_chars(chars) == octets, "%s != %s <- %s" % (octets, base62.num_octets_that_encode_to_this_many_chars(chars), chars)
def _test_ende(self, bs):
as=base62.b2a(bs)
bs2=base62.a2b(as)
assert bs2 == bs, "bs2: %s:%s, bs: %s:%s, as: %s:%s" % (len(bs2), `bs2`, len(bs), `bs`, len(as), `as`)
ascii=base62.b2a(bs)
bs2=base62.a2b(ascii)
assert bs2 == bs, "bs2: %s:%s, bs: %s:%s, ascii: %s:%s" % (len(bs2), `bs2`, len(bs), `bs`, len(ascii), `ascii`)
def test_num_octets_that_encode_to_this_many_chars(self):
return self._test_num_octets_that_encode_to_this_many_chars(2, 1)