4 ms·
Are generators really an advanced feature? I've used them pretty often (instead of returning a list) and they're pretty simple.
by witty_username 10y ago
Are generators really an advanced feature? I've used them pretty often (instead of returning a list) and they're pretty simple.
- pjmlp 10y agoFor many types of programmers that would be happy with something like C or Go, most likely yes, given that they already allow for some interesting patterns. Also because they changed a bit, in the early days you could not pass arguments back to them. However, when I wrote generators I was actually thinking about comprehensions.
- witty_username 10y agoI think comprehensions are less advanced (they're a specialized case of iterators) and very commonly used. > Also because they changed a bit, in the early days you could not pass arguments back to them. Sending arguments is certainly advanced.