I'm not just sharing my personal thoughts here. I know half a dozen people who tried and failed to start learning programming with Python. Some of them moved onto other languages and had a better time while others gave up on the skill entirely. This is just what I've learned from discussing the issues they had. I have no reason to disparage Python. It's my favorite language and by far the one I use most.
A beginner would further only care about its observable effects, which here would be at best something like "that returns something that's like a tuple containing the integers from 0 to n-1" and at worst "it makes my for loop run n times". Which is actually a fairly reasonable interpretation as long as the beginner doesn't try to concatenate a range with a tuple.
When I write a for loop in Python, I don't think about StopIteration and stuff, I just want to iterate something. Only if I were to implement a custom generator or iterable would I worry about that.
I didn't not say anything about how `range()` is implemented. I only described exactly what you said the caller should care about: the interface. I briefly described the inputs and outputs, then I went into detail about how the output is used by the `for` loop.
> A beginner would further only care about its observable effects, which here would be at best something like "that returns something that's like a tuple containing the integers from 0 to n-1"
In which case you need to describe what a tuple is and how a for loop uses it. In which case we're back to talking about iterators. All `for` loops in Python use iterators. There is no getting away from that.
> When I write a for loop in Python, I don't think about StopIteration and stuff, I just want to iterate something. Only if I were to implement a custom generator or iterable would I worry about that.
Same for me. That's because we already know how this all works and we know what parts we actually need to consider to implement a solution. That hardest part of getting into programming is building a fundamental understanding of how features work and how you can use those features to solve problems. And Python is filled to the brim with relatively complex features designed to help experienced programmers solve complex problems quickly and easily.
Like I said in my original post, you can gloss over details if you want. But understanding iterators is essential to understanding how `for` loops work in Python and if you don't understand how a `for` loop works, you'll struggle with understanding how and when to use it in future applications.
Abstractions are a good thing. When I write that for loop in C, I don't need to worry how the compiler will translate this into an abstract syntax tree, how that tree gets transformed into machine code nor how the microprocessor will interpret and execute it. I just think in terms of the abstract C machine model unless I need to peek under, usually for performance reasons.
If you truly believe in first principles for teaching programming languages, there's Forth, where a minimal implementation is basically a dozen or so of native primitives and an indirect threaded code core, leaving everything else to the programmer (disclaimer: I've never programmed in Forth nor bootstrapped an interpreter). Or Brainfuck if you don't mind a Turing tarpit, but I'd think twice before introducing that as a beginner's first programming language.