die Python-Dokumentation schreibt zu slice():
Slice objects have read-only data attributes start, stop and step which merely return the argument values (or their default). They have no other explicit functionality; however they are used by Numerical Python and other third party extensions.
- 1. Wenn dem so ist, weshalb ist slice() dann eine built-in Funktion? Und warum islice() nicht, wird es doch ganz konkret bei Generatoren benötigt, bei denen ein Zugriff mit [::] naturgemäß nicht funktioniert?
2. Hätte mir jemand mal ein Beispiel, wo ich mit [::] nicht weiterkomme und slice() brauche?
3. Ist es richtig, dass islice() i. d. R. nur bei Generatoren zum Einsatz kommt?
mutetella