質問編集履歴
2
追記 1
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -43,8 +43,18 @@
|
|
|
43
43
|
|
|
44
44
|
python3 でmapの挙動が変わったらしいまではわかったのですが、次のコードが何をやっているのか全く分からず、困っています。 コードを説明してもらえませんでしょうか。
|
|
45
45
|
|
|
46
|
+
|
|
46
47
|
```python
|
|
47
48
|
args_dict = dict(map(lambda x: [x.partition("=")[0],
|
|
48
49
|
x.partition("=")[2]],
|
|
49
50
|
args[1:])[x] for x in range(len(args) - 1))
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
答え (途中)
|
|
54
|
+
lambda は無名関数
|
|
55
|
+
```python
|
|
56
|
+
>>>g = lambda x: [x.partition("=")[0], x.partition("=")[2]]
|
|
57
|
+
|
|
58
|
+
>>>g("command=listApis")
|
|
59
|
+
['command', 'listApis']
|
|
50
60
|
```
|
1
タイトルを修正
title
CHANGED
|
@@ -1,1 +1,1 @@
|
|
|
1
|
-
TypeError
|
|
1
|
+
TypeError map object is not subscriptable
|
body
CHANGED
|
File without changes
|