[Python-ideas] Adding "Typed" collections/iterators to Python

Serhiy Storchaka storchaka at gmail.com
Mon Dec 19 09:33:40 CET 2011


19.12.11 01:28, Nathan Rice написав(ла):
> L2 = [X(e) for e in L1]
> L3 = [Y(e) for e in L2]
> vs
> L2 = X(L1) # assuming X has been updated to work in both vector/scalar
> L3 = Y(L2) # context...

L = ['a', 'bc', ['ada', 'a']]

What is len(L)? 3 or [1, 2, 2] or [1, 2, [3, 1]]?

> L2 = [Z(Y(X(e))) for e in L1]
> vs
> L2 = Z(Y(X(L1)))
>
> L2 = [e.X().Y().Z() for e in L1]
> vs
> L2 = L1.X().Y().Z() # assuming vectorized versions of member methods
> #are folded into the collection via the mixin.

What is L.count('a')? 1 or [1, 0, 1] or [1, 0, [2, 1]]?




More information about the Python-ideas mailing list