Operating system: Ubuntu 19.04
Python version: 3.7.2
Black version: 19.3b0
Does also happen on master: yes
Black forces the use of parentheses on tuples of one element without parentheses. Check the black diff below:
class LivenessProbe(View):
"""Liveness probe handler."""
- methods = "GET",
+ methods = ("GET",)
def dispatch_request(self) -> Response:
I'd say this is a feature, not a bug. A single comma is easy to miss, and the parentheses make it clearer that it's a tuple.
The fact that methods = "GET", is valid python syntax is incredibly annoying. It causes so many hard-to-find bugs and is basically useless.
No action required here.
Most helpful comment
I'd say this is a feature, not a bug. A single comma is easy to miss, and the parentheses make it clearer that it's a tuple.