A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/google/yapf/issues/1170 below:

PEP 695 Type Parameter Syntax · Issue #1170 · google/yapf · GitHub

Issue

In PEP-695, running under 3.12 will cause exceptions in YAPF. For example the following two lines of code for testing:

type Testing = dict[int | str]
type Testing2 = dict[str: int]

The following error message happens:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/josh.lam/.local/yapf/yapf/__main__.py", line 18, in <module>
    yapf.run_main()
  File "/home/josh.lam/local/.pyenv/versions/3.12.0/lib/python3.12/site-packages/yapf/__init__.py", line 377, in run_main
    sys.exit(main(sys.argv))
             ^^^^^^^^^^^^^^
  File "/home/josh.lam/.local/.pyenv/versions/3.12.0/lib/python3.12/site-packages/yapf/__init__.py", line 136, in main
    changed = FormatFiles(
              ^^^^^^^^^^^^
  File "/home/josh.lam/.local/.pyenv/versions/3.12.0/lib/python3.12/site-packages/yapf/__init__.py", line 214, in FormatFiles
    changed |= _FormatFile(filename, lines, style_config, no_local_style,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh.lam/local/.pyenv/versions/3.12.0/lib/python3.12/site-packages/yapf/__init__.py", line 248, in _FormatFile
    raise errors.YapfError(errors.FormatErrorMsg(e))
                           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh.lam/.local/.pyenv/versions/3.12.0/lib/python3.12/site-packages/yapf/yapflib/errors.py", line 37, in FormatErrorMsg
    return '{}:{}:{}: {}'.format(e.args[1][0], e.args[1][1], e.args[1][2], e.msg)
                                 ~~~~~~^^^
IndexError: tuple index out of range
>>>>> In file /home/josh.lam/testing.py <<<<<
1,2d0
< type Testing = dict[int | str]
< type Testing2 = dict[str: int]
Other Info Yapf Configuration file:
[style]
based_on_style = google

column_limit = 120
split_before_arithmetic_operator = true

Sidneys1, sjschaff, Patrik112358, qi55wyqu, Jaid and 8 moredevx00, jorenham, Patrik112358 and jrpat


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4