Put blank lines between nested classes in typing stubs
See original GitHub issueDescribe 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:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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.
I’m in favor of making this change, but cc fellow typeshed maintainers @srittau @akuli @hauntsaninja.