lensvol / pybetter

Tool for fixing trivial problems with your code.
MIT License
62 stars 7 forks source link

BUG: Incorrect handling of `return ()` #108

Closed rs2 closed 2 years ago

rs2 commented 2 years ago

The following exception is raised when optimizing the following snippet:

def foo(): -> typing.Tuple:
    return ()

libcst._nodes.base.CSTValidationError: A zero-length tuple must be wrapped in parentheses.

It is incorrect to replace return () with return ,.

lensvol commented 2 years ago

Thank you! Will fix it soon.