Python: AttributeError: l'objet 'NoneType' n'a aucun attribut 'append'

Mon programme ressemble à

# global
item_to_bucket_list_map = {}

def fill_item_bucket_map(items, buckets):
    global item_to_bucket_list_map

    for i in range(1, items + 1):
        j = 1
        while i * j <= buckets:
            if j == 1:
                item_to_bucket_list_map[i] = [j]
            else:
                item_to_bucket_list_map[i] = (item_to_bucket_list_map.get(i)).append(j)
            j += 1
        print "Item=%s, bucket=%s" % (i, item_to_bucket_list_map.get(i))


if __name__ == "__main__":
    buckets = 100
    items = 100
    fill_item_bucket_map(items, buckets)

Lorsque je l'exécute, il me jette

AttributeError: 'NoneType' object has no attribute 'append'

Pas sûr de savoir pourquoi cela se passerait-il? Quand je suis déjà à la création d'une liste au début de chaque j

source d'informationauteur daydreamer