On Thu, Dec 14, 2017 at 3:22 AM, 'Marcel Franke' via leo-editor <
[email protected]> wrote:

>
>
> Am Mittwoch, 13. Dezember 2017 22:28:50 UTC+1 schrieb Edward K. Ream:
>
> def a_generator():
>>     if 0:
>>         yield 'abc' # Makes the function a generator
>>     return None
>>
>
> This only works with Python 3. Python 2  does not support mixing return
> and yield.
>

​Thanks for this.  I thought I tested this with Python 2, but apparently
not.
​

>  It's also overcomplicated.
>

​It was just a test of the idea.​

Proper way to handle this is
>
> classes_list.extend(do_class(node if node else []))
>

​In our code, bool(node) is always True, so this comment is a bit off the
mark.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to