7 ms·
Because it sure sounds similar. Look at Python's PEP 544, for example.
by nerdponx 9y ago
Because it sure sounds similar. Look at Python's PEP 544, for example.
- masklinn 9y agoThe only commonality I can see is that both use the word "protocol"…
- nerdponx 9y agoAnySequence is a behavior specification, right? That seems pretty structural to me.
- mikeash 9y agoAnySequence is a concrete type conforming to the Sequence protocol. It implements Sequence by forwarding calls to some other implementation of Sequence.
- thewayfarer 9y agoStrictly speaking, AnySequence is a generic type, whereas AnySequence<Int>, AnySequence<String>, and AnySequence<Any> would be three different concrete types.
- masklinn 9y agoAnySequence is a named type conforming to a named protocol, it's all nominative. I don't know that Swift even has a structural subset.