We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
Black crashes when run with the input below, I was asked to report a bug. Searched issues for staticmethod and I wasn't able to find a duplicate bug.
staticmethod
To Reproduce Steps to reproduce the behavior:
Run black on the following minimal reproducer:
class A: def f(self): # fmt: off pass # fmt: an @staticmethod def g(): pass
Expected behavior Not to crash!
Does this bug also happen on master?
Tried on black.now.sh and got the same error. Link: https://black.now.sh/?version=master&state=_Td6WFoAAATm1rRGAgAhARYAAAB0L-Wj4ADPAHVdAD2IimZxl1N_WlXnON2nzNApqtITJJee2SMStFF7KJQ8b8DURX_4mSWuyzahm7XyRnFJw4Xsk-T0s6r9WQ1aWsFX30SYGTYIsr7er5h3jUgBMQ57uo6Vc7Nk2Ne4nD8I-8B1sA_8mxK9s2PHSQ37LUEOhsaewAAAAAB48B9ldZJwDgABkQHQAQAAJeuZD7HEZ_sCAAAAAARZWg==
Additional context Add any other context about the problem here.
--- src +++ dst @@ -25,44 +25,44 @@ None, # NoneType ) # /arguments body= Pass( ) # /Pass + FunctionDef( + args= + arguments( + args= + defaults= + kw_defaults= + kwarg= + None, # NoneType + kwonlyargs= + posonlyargs= + vararg= + None, # NoneType + ) # /arguments + body= + Pass( + ) # /Pass + decorator_list= + Name( + ctx= + Load( + ) # /Load + id= + 'staticmethod', # str + ) # /Name + name= + 'g', # str + returns= + None, # NoneType + type_comment= + None, # NoneType + ) # /FunctionDef decorator_list= name= 'f', # str - returns= - None, # NoneType - type_comment= - None, # NoneType - ) # /FunctionDef - FunctionDef( - args= - arguments( - args= - defaults= - kw_defaults= - kwarg= - None, # NoneType - kwonlyargs= - posonlyargs= - vararg= - None, # NoneType - ) # /arguments - body= - Pass( - ) # /Pass - decorator_list= - Name( - ctx= - Load( - ) # /Load - id= - 'staticmethod', # str - ) # /Name - name= - 'g', # str returns= None, # NoneType type_comment= None, # NoneType ) # /FunctionDef
The text was updated successfully, but these errors were encountered:
Hey thanks for the bug report, but I'll be closing as it's a duplicate of #569.
Sorry, something went wrong.
Sorry, must have missed that. Thanks!
Just realised after re-reading that I typed an with an A not on - sorry for the noise. Will keep an eye on #1817.
an
A
Thanks for maintaining Black!
No branches or pull requests
Describe the bug
Black crashes when run with the input below, I was asked to report a bug. Searched issues for
staticmethod
and I wasn't able to find a duplicate bug.To Reproduce Steps to reproduce the behavior:
Run black on the following minimal reproducer:
Expected behavior Not to crash!
Does this bug also happen on master?
Tried on black.now.sh and got the same error. Link: https://black.now.sh/?version=master&state=_Td6WFoAAATm1rRGAgAhARYAAAB0L-Wj4ADPAHVdAD2IimZxl1N_WlXnON2nzNApqtITJJee2SMStFF7KJQ8b8DURX_4mSWuyzahm7XyRnFJw4Xsk-T0s6r9WQ1aWsFX30SYGTYIsr7er5h3jUgBMQ57uo6Vc7Nk2Ne4nD8I-8B1sA_8mxK9s2PHSQ37LUEOhsaewAAAAAB48B9ldZJwDgABkQHQAQAAJeuZD7HEZ_sCAAAAAARZWg==
Additional context Add any other context about the problem here.
Error log/diff:
The text was updated successfully, but these errors were encountered: