Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E275: Warning for parenthesized (yield) #1090

Closed
jpmckinney opened this issue Aug 2, 2022 · 0 comments · Fixed by #1091 or eduNEXT/eox-core#303
Closed

E275: Warning for parenthesized (yield) #1090

jpmckinney opened this issue Aug 2, 2022 · 0 comments · Fixed by #1091 or eduNEXT/eox-core#303

Comments

@jpmckinney
Copy link

jpmckinney commented Aug 2, 2022

For example:

https://github.com/ICRAR/ijson/blob/3100b96e0c5bd52cda971228dcd61a853ad92257/ijson/common.py#L139-L161

@utils.coroutine
def items_basecoro(target, prefix, map_type=None):
    '''
    An couroutine dispatching native Python objects constructed from the events
    under a given prefix.
    '''
    while True:
        current, event, value = (yield)
        if current == prefix:
            if event in ('start_map', 'start_array'):
                object_depth = 1
                builder = ObjectBuilder(map_type=map_type)
                while object_depth:
                    builder.event(event, value)
                    current, event, value = (yield)
                    if event in ('start_map', 'start_array'):
                        object_depth += 1
                    elif event in ('end_map', 'end_array'):
                        object_depth -= 1
                del builder.containers[:]
                target.send(builder.value)
            else:
                target.send(value)

Output:

E275 missing whitespace after keyword
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant