File: python312.py

package info (click to toggle)
pycodestyle 2.12.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 624 kB
  • sloc: python: 4,697; makefile: 135; sh: 12
file content (31 lines) | stat: -rw-r--r-- 449 bytes parent folder | download | duplicates (2)
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
#: Okay
# https://github.com/python/cpython/issues/90432: fixed in 3.12
def foo():
    pas

\

def bar():
    pass
#: Okay
# new type aliases
type X = int | str
type Y[T] = list[T]
type Z[T: str] = list[T]
#: Okay
# new generics
def f[T](x: T) -> T:
    pass


def g[T: str, U: int](x: T, y: U) -> dict[T, U]:
    pass
#: Okay
# new nested f-strings
f'{
    thing
} {f'{other} {thing}'}'
#: E201:1:4 E202:1:17
f'{ an_error_now }'
#: Okay
f'{x:02x}'