python specific

  1. list __getitem__ s
    the[]syntax for getting item by key or index is just syntax sugar. When you evaluatea[i]Python callsa.__getitem__(i)

    (ortype(a).__getitem__(a, i) Even if the class ofamay not explicitly define this method, it is usually inherited from an ancestor class.
    https://stackoverflow.com/questions/43627405/understanding-getitem-method

  2. yield, iterable, generators,
    yield just create the object once, do not store it in memory.
    https://stackoverflow.com/questions/231767/what-does-the-yield-keyword-do

results matching ""

    No results matching ""