Implement itemgetter partially

This commit is contained in:
Dave Halter
2018-09-04 00:01:55 +02:00
parent 35ce54630e
commit 38176ae7e6
4 changed files with 31 additions and 11 deletions

View File

@@ -247,12 +247,25 @@ with contextlib.closing('asd') as string:
import operator
f = operator.itemgetter([1])
f = operator.itemgetter(1)
#? float()
f([1.0])
#? str()
f([1, ''])
g = operator.itemgetter(1, 2)
x1, x2 = g([1, 1.0, ''])
#? float()
x1
#? float()
x2
x1, x2 = g([1, ''])
#? str()
x1
#? int() str()
x2
# -----------------
# shlex
# -----------------