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

frozenset defined inline isn't formatted by black (gives error) #1821

Closed
SamuelMarks opened this issue Nov 14, 2020 · 1 comment
Closed

frozenset defined inline isn't formatted by black (gives error) #1821

SamuelMarks opened this issue Nov 14, 2020 · 1 comment
Labels
C: unstable formatting Formatting changed on the second pass R: duplicate This issue or pull request already exists T: bug Something isn't working

Comments

@SamuelMarks
Copy link

Describe the bug
INTERNAL ERROR: Black produced different code on the second pass of the formatter.

To Reproduce

import typing
from itertools import chain

BUILTIN_TYPES = frozenset(chain.from_iterable(map(lambda s: (s, 'typing.{}'.format(s), '_extensions.{}'.format(s)),
                          filter(lambda s: s[0].isupper() and not s.isupper(), dir(typing))))
                          ) | frozenset(("int", "float", "str", "dict", "list", "tuple"))

print("BUILTIN_TYPES:", BUILTIN_TYPES, ";")

Expected behavior A clear and concise description of what you expected to happen.

Environment (please complete the following information):

  • Version: 20.8b1
  • OS and Python version: Python 3.9.0rc1

Does this bug also happen on master?
Yes

https://black.now.sh/?version=master,&state=_Td6WFoAAATm1rRGAgAhARYAAAB0L-Wj4AHpARNdAD2IimZxl1N_WlwxRhR7MSgFUcTLI8hN1VTiqSc6I8LAH6EHQRd_DW_FQ2Acs-7eyVLlLqFlJY97xcFQgMNqfMsPfyRA1tn2uZK4G_SB8EnPLudh36ydjJATZhNupmrJeBpMdTR7wxNc4GXb15gSBMp0wzRXkGxp_T6u_4293hZIp4O0xyaUEyZf5SW3ykrFzUvsza9kFN8ODCBiMfmAEXkeYI0l4QxWOvrrkYq4CjwPQEy2pIAm528m5HXb4GrtveyIAqNqBQQZ180J1MX5Nl73Tz_YprfV_LP97eWOY8teby2-QIdDYG7smuPqV5e1VSf_X6Ts08wojl1P041mtP8bxtW6mNQVs5hjqn-w7akYZzYXAADui1ofwGDjWwABrwLqAwAAgztb6rHEZ_sCAAAAAARZWg==

Additional context

@SamuelMarks SamuelMarks added the T: bug Something isn't working label Nov 14, 2020
SamuelMarks added a commit to offscale/cdd-python that referenced this issue Nov 15, 2020
…ring_parsers.py,tests/mocks/docstrings.py] Linting
@ichard26 ichard26 added the C: unstable formatting Formatting changed on the second pass label Nov 16, 2020
@ichard26 ichard26 added the R: duplicate This issue or pull request already exists label Apr 25, 2021
@ichard26
Copy link
Collaborator

Hello!

All reproduction cases in this issue format without error on master. The fixing commit was 8672af3 from PR GH-2126. I'll be marking this issue as a duplicate of GH-1629 since that's what GH-2126 aimed to fix and it's highly likely this issue falls under GH-1629.

Since we use the issue tracker as a reflection of what's on master, I'll be closing this issue. If you have any issues, especially with the new (but stable) output, please open a new issue. Oh and the fix should be available in a published release soon, see GH-2125 for more info.

Thank you for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: unstable formatting Formatting changed on the second pass R: duplicate This issue or pull request already exists T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants