File: err_186.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 (22 lines) | stat: -rw-r--r-- 390 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
l = []

# these should match

l = sorted(l)
l = sorted(l, key=lambda x: x > 0)
l = sorted(l, reverse=True)
l = sorted(l, key=lambda x: x > 0, reverse=True)


# these should not

l2 = sorted(l)
l2 = sorted(l, key=lambda x: x > 0)
l2 = sorted(l, reverse=True)

d = {}

# dont warn since d is a dict and does not have a .sort() method
d = sorted(d)

l = sorted(l, lambda x: x)  # type: ignore