pycodestyle icon indicating copy to clipboard operation
pycodestyle copied to clipboard

E303: Does not report, that a blank line between classes is needed, if they're defined inside an if statement

Open CreamyCookie opened this issue 9 years ago • 21 comments

As stated in PEP8:

Separate top-level function and class definitions with two blank lines.

if __name__ == '__main__':
    class Pos:

        def __init__(self, x, y):
            self.x = x
            self.y = y

    class Lifetime:

        def __init__(self, lifetime):
            if lifetime < 0:
                raise ValueError('lifetime must be above 0')
            self.lifetime = lifetime

    class Name:

        def __init__(self, name):
            self.name = '"' + name + '"'

CreamyCookie avatar Jan 03 '15 17:01 CreamyCookie

Svelvet 8 now features composable Edges, so the new way to achieve this (if I'm understanding you correctly) would be to pass the Edge as a child of the Anchor component with slot=edge. You can then pass whatever context specific props you want.

briangregoryholmes avatar Jun 23 '23 02:06 briangregoryholmes

@briangregoryholmes is there a way to change the position of the label? E.g. at the end of the child node?

KiraPC avatar Jul 10 '23 11:07 KiraPC

@KiraPC A version released today will have a new labelPosition prop on the Edge component that takes a value between 0 an 1 (defaults to 0.5).

briangregoryholmes avatar Jul 15 '23 14:07 briangregoryholmes

Amazing. I'll try it in this week

KiraPC avatar Jul 15 '23 14:07 KiraPC