Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Are generators really an advanced feature? I've used them pretty often (instead of returning a list) and they're pretty simple.


For 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.


I 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: