[Libre-soc-isa] [Bug 686] create Power ISA test API

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Thu Sep 9 20:53:12 BST 2021


https://bugs.libre-soc.org/show_bug.cgi?id=686

Jacob Lifshay <programmerjake at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |programmerjake at gmail.com

--- Comment #18 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #17)
> that looks really good, it's starting to take shape.  a quick tip:
> to turn any function into a generator, just add "yield" somewhere
> in it. first line will do.  not "yield something", just one word,
> "yield".

umm, actually you want the `yield` somewhere where it won't be executed,
because `yield` does actually yield None which is probably not desired:
def yield_none():
    yield # equivalent to `yield None`

print(list(yield_none())) # prints `[None]`

if you want a generator that doesn't yield anything, do like so:
def yield_nothing():
    if False:
        yield

print(list(yield_nothing())) # prints `[]`

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Libre-SOC-ISA mailing list