question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Put blank lines between nested classes in typing stubs

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
JelleZijlstracommented, Jan 19, 2022

@hauntsaninja we made some changes around that in #2472, but agree that we should space in your example too. Feel free to open a new issue. We also have an unreleased change in #2736.

1reaction
JelleZijlstracommented, Jan 19, 2022

I’m in favor of making this change, but cc fellow typeshed maintainers @srittau @akuli @hauntsaninja.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Type Stubs — typing documentation - Static Typing with Python
Blank Lines ¶. Do not use empty lines between functions, methods, and fields, except to group them with one empty line. Use one...
Read more >
How to add type hints for an inner or nested function inside the ...
In short, this allows type hints for names that have not been defined yet. As you can guess, when Python parses the file,...
Read more >
PEP 484 – Type Hints - Python Enhancement Proposals
This includes support for off-line type checkers such as mypy, ... A generic class nested in another generic class cannot use same type...
Read more >
Unit Testing with Stubs and Mocks - Spring
This saves us a lot of time maintaining stub classes as separate ... and to implement the stub inline requires dozens of lines...
Read more >
Best Practices for Spies, Stubs and Mocks in Sinon.js
With databases, you need to have a testing database set up with data for your tests. All of this means that writing and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found