Skip to content

Put blank lines between nested classes in typing stubs #2783

@MarkKoz

Description

@MarkKoz

Describe the style change

Nested classes in typing stubs should have blank lines between them.

Examples in the current Black style

class A:
    class B:
        attribute: int
    class C:
        attribute: int
    def method(self) -> None: ...
    def method2(self) -> None: ...

Desired style

class A:
    class B:
        attribute: int
    
    class C:
        attribute: int
    
    def method(self) -> None: ...
    def method2(self) -> None: ...

Additional context

See this for a live demo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    F: empty linesWasting vertical space efficiently.S: acceptedThe changes in this design / enhancement issue have been accepted and can be implementedT: styleWhat do we want Blackened code to look like?

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions