formate.ellipses

Move ellipses (...) for type stubs onto the end of the stub definition.

Before:

def foo(value: str) -> int:
    ...

After:

def foo(value: str) -> int: ...
class EllipsisRewriter(source)[source]

Bases: Rewriter

Move ellipses (...) for type stubs onto the end of the stub definition.

Parameters

source (str) – The source to reformat.

rewrite_ellipsis(node)[source]

Responsible for the actual rewriting.

ellipsis_reformat(source)[source]

Move ellipses (...) for type stubs onto the end of the stub definition.

Before:

def foo(value: str) -> int:
    ...

After:

def foo(value: str) -> int: ...
Parameters

source (str) – The source to reformat.

Return type

str

Returns

The reformatted source.