]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/black/tests/data/cases/pep_572.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '882d8795c6ff65c02f2657e596391748d1b6b7f5'
[etc/vim.git] / .vim / bundle / black / tests / data / cases / pep_572.py
1 # flags: --minimum-version=3.8
2 (a := 1)
3 (a := a)
4 if (match := pattern.search(data)) is None:
5     pass
6 if match := pattern.search(data):
7     pass
8 [y := f(x), y**2, y**3]
9 filtered_data = [y for x in data if (y := f(x)) is None]
10 (y := f(x))
11 y0 = (y1 := f(x))
12 foo(x=(y := f(x)))
13
14
15 def foo(answer=(p := 42)):
16     pass
17
18
19 def foo(answer: (p := 42) = 5):
20     pass
21
22
23 lambda: (x := 1)
24 (x := lambda: 1)
25 (x := lambda: (y := 1))
26 lambda line: (m := re.match(pattern, line)) and m.group(1)
27 x = (y := 0)
28 (z := (y := (x := 0)))
29 (info := (name, phone, *rest))
30 (x := 1, 2)
31 (total := total + tax)
32 len(lines := f.readlines())
33 foo(x := 3, cat="vector")
34 foo(cat=(category := "vector"))
35 if any(len(longline := l) >= 100 for l in lines):
36     print(longline)
37 if env_base := os.environ.get("PYTHONUSERBASE", None):
38     return env_base
39 if self._is_special and (ans := self._check_nans(context=context)):
40     return ans
41 foo(b := 2, a=1)
42 foo((b := 2), a=1)
43 foo(c=(b := 2), a=1)
44
45 while x := f(x):
46     pass
47 while x := f(x):
48     pass