Skip to content
New issue

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

Commented type argument #3619

Closed
josephcomisi opened this issue Mar 23, 2023 · 1 comment
Closed

Commented type argument #3619

josephcomisi opened this issue Mar 23, 2023 · 1 comment
Labels
T: bug Something isn't working

Comments

@josephcomisi
Copy link

Hello,

I did not dive into the issue but this can still help, so here is what happens:

I use tox to run black, mypy and unittest.

I have dataclasses with several arguments. One of the arguments was commented and was named type, such as:

@dataclass
class A:
    first: int
    # type: int

Even though it was commented out, I have the following error message:
error: cannot format ..../.../: cannot use --safe with this file; failed to parse source file AST: expected an indented block after class definition on line 190 (, line 191)
This could be caused by running Black with an older Python version that does not support new syntax used in your source file.

Oh no! 💥 💔 💥

I am not sure it is the intended behaviour. If it is, please disregard this issue.

@josephcomisi josephcomisi added the T: bug Something isn't working label Mar 23, 2023
@JelleZijlstra
Copy link
Collaborator

This was fixed on main just a few days ago (#3594). I will cut a new release soon.

@JelleZijlstra JelleZijlstra closed this as not planned Won't fix, can't repro, duplicate, stale Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants