blob: ac8ecc3932b6337cb6db2af45195d4fb6f2c787b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# 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
|