[red-knot] Autoformat mdtest Python snippets using blacken-docs (#13809)

This commit is contained in:
Alex Waygood
2024-10-19 15:57:06 +01:00
committed by GitHub
parent 2ff36530c3
commit 36cb1199cc
45 changed files with 331 additions and 132 deletions

View File

@@ -3,7 +3,7 @@
## Simple
```py
s = 'abcde'
s = "abcde"
reveal_type(s[0]) # revealed: Literal["a"]
reveal_type(s[1]) # revealed: Literal["b"]
@@ -14,7 +14,7 @@ a = s[8] # error: [index-out-of-bounds] "Index 8 is out of bounds for string `L
reveal_type(a) # revealed: Unknown
b = s[-8] # error: [index-out-of-bounds] "Index -8 is out of bounds for string `Literal["abcde"]` with length 5"
reveal_type(b) # revealed: Unknown
reveal_type(b) # revealed: Unknown
```
## Function return
@@ -23,7 +23,8 @@ reveal_type(b) # revealed: Unknown
def add(x: int, y: int) -> int:
return x + y
a = 'abcde'[add(0, 1)]
a = "abcde"[add(0, 1)]
# TODO: Support overloads... Should be `str`
reveal_type(a) # revealed: @Todo
```