File: err_102.py

package info (click to toggle)
python-refurb 1.27.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,700 kB
  • sloc: python: 9,468; makefile: 40; sh: 6
file content (25 lines) | stat: -rw-r--r-- 764 bytes parent folder | download
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
name = "bob"
last_name = b"smith"

# these should match
_ = name.startswith("a") or name.startswith("b")
_ = name.endswith("a") or name.endswith("b")
_ = last_name.startswith(b"a") or last_name.startswith(b"b")
_ = name.startswith("a") or name.startswith("b") or True

_ = not name.startswith("a") and not name.startswith("b")


# these should not match
_ = name.startswith("a") and name.startswith("b")

name_copy = name
_ = name.startswith("a") or name_copy.startswith("b")

_ = name.startswith() or name.startswith("x")  # type: ignore

_ = name.startswith("x") or name.startswith("y") and True

_ = not name.startswith("a") or not name.startswith("b")
_ = not name.startswith("a") and name.startswith("b")
_ = name.startswith("a") and not name.startswith("b")