Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d84b134

Browse files
committed
refactor(component): refactor
1 parent d1c7d90 commit d84b134

32 files changed

+48
-115
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,6 @@ test.*
115115
.idea
116116
test*
117117
node_modules
118+
temp*
118119

119120

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
req:
2+
freeze:
33
pip freeze > requirements.txt
44
in-pre:
55
pre-commit install

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ print(compare_2_dict(dicta, dictb))
407407

408408
```
409409

410-
### 12. lambda
410+
### 12. Lambda
411411
* 在 for loop 中使用 lambda,如果有赋值,请小心
412412

413413
```py
@@ -418,4 +418,18 @@ res_t = [func() for func in t]
418418
res_m = [func() for func in m]
419419
```
420420
* res_t: [3, 3, 3, 3]
421-
* rest_m: [0, 1, 2, 3]
421+
* rest_m: [0, 1, 2, 3]
422+
423+
### 13. Iterator
424+
* iterator 不走回头路,可以利用此特性来判断 list 是否存在于另一个 list 中
425+
426+
```py
427+
# a = [1,2,3]
428+
# b = [1,3,2,4,5,6]
429+
# check if all num in a is in b, ordered
430+
# [1,2,3] is in [1,2,3,4] but [1,2,3] is not in [1,3,2,4]
431+
432+
def check(a, b):
433+
b = iter(b)
434+
return all(i in b for i in a)
435+
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

generator.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

parse.py

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)