Changes between Initial Version and Version 1 of Ticket #17979, comment 128


Ignore:
Timestamp:
03/26/15 07:22:34 (4 years ago)
Author:
nthiery
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #17979, comment 128

    initial v1  
    1010>   {{{return lambda i: l[i] if (i >= 0 and i < len(l) and i in ZZ) else default}}}
    1111
    12 Given that this is a critical section and an internal function, I just
    13 changed this to assume that i is a non negative integer, and only
    14 check on i < len(l). Does this sound ok?
     12Given that this is a critical section and an internal function, I just changed this to assume that i is a non negative integer, and only check on i < len(l). Does this sound ok?
    1513
    1614> - The documentation reads that `n` can be an iterable, but the code of
    1715>   `__contains__` does not agree.
    1816
    19 This is because `IntegerListsLex(n, ...)` returns a
    20 `DisjointEnumeratedSets` of `IntegerListsLex`'s if `n` is an
    21 iterable. This way all the rest of the code can just ignore the
    22 existence of this feature.
     17This is because `IntegerListsLex(n, ...)` returns a `DisjointEnumeratedSets` of `IntegerListsLex`'s if `n` is an iterable. This way all the rest of the code can just ignore the existence of this feature.
    2318
    24 The downside is that `__contains__` is slower (it will run through the
    25 different IntegerListsLex, and check contains there). Especially if
    26 the iterable is infinite. But that's not an important feature, so
    27 that's ok I believe.
     19The downside is that `__contains__` is slower (it will run through the different `IntegerListsLex`, and check `__contains__` there). Especially if the iterable is infinite. But that's not an important feature, so that's ok I believe.