On Sat, Aug 16, 2014 at 3:17 PM, Jonas Wielicki <j.wielicki@sotecware.net> wrote:
For what it’s worth, I know this problem very well, and it can takeOn 16.08.2014 23:46, Neil Girdhar wrote:
> I'm sure this has been suggested before, but I just spent two days trying
> to figure out why a method wasn't being called only to find that I'd
> accidentally pasted a yield into the function. What is the argument
> against a different keyword for introducing generator functions/methods?
>
> If it's backward compatibility, then my suggestion to have a from
> __future__ and then make it real in Python 4.
hours to figure out whats wrong.A linter should be able to figure this out. For example, mypy will insist that a generator has a return type of Iterable[...]. So maybe you won't have to wait for Python 4; if the mypy proposal goes forward you will be able to use type annotations to distinguish generators.
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
--
---
You received this message because you are subscribed to a topic in the Google Groups "python-ideas" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python-ideas/5-Qm2od4xQ8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python-ideas+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.