0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00
Files
vim/runtime/syntax/testdir/input/python_ellipsis.py
Doug Kearns 15070eee2f runtime(python): Update syntax, fix pythonEllipsis pattern
fixes: #18263
closes: #18264

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-11 13:54:51 -04:00

47 lines
723 B
Python

# Ellipsis Literal
# https://docs.python.org/3/library/constants.html#Ellipsis
# Placeholders
...
...
x = ...
y = ... # Comment
class C: ...
lambda: ...
# Annotations
numbers: Tuple[int, ...]
# Doctests
"""A doctest
>>> class A:
... def __init__(self):
... ...
>>> class B: ...
>>> x = ...
>>> raise ValueError('multi\n line\ndetail')
Traceback (most recent call last):
...
ValueError: multi
line
detail
>>> print(list(range(20))) # doctest: +ELLIPSIS
[0, 1, ..., 18, 19]
>>> exec(s) #doctest: +ELLIPSIS
-3.21716034272e-0...7
"""
class C:
"""
>>> class C:
... def __init__(self):
... ...
"""
# Numpy
x[..., 0]
# Issue #18263 (Python highlighting ellipsis, false positive)
a = ".." # comment