Skip to content

Commit 9bb680d

Browse files
author
Sune Debel
committed
docs: improve lens docs
1 parent dd3c0c6 commit 9bb680d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/immutable_objects_and_data.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ d = {
8282
},
8383
'd': 'but not this'
8484
}
85+
86+
8587
new_d = d.copy()
8688
new_d['a'] = d['a'].copy()
8789
new_d['a']['b'] = d['a']['b'].copy()
@@ -101,7 +103,6 @@ from pfun import lens
101103

102104
t = lens()['a']['b']['c']
103105
new_d = t('Wow that was a lot easier!')(d)
104-
assert new_d['a']['b']['c'] == 'Wow that was a lot easier!'
105106
```
106107
If you use the `pfun` MyPy plugin, you can give a type as an argument to `lens`, which allows MyPy to check that the operations you make on the lens object are supported by the type you intend to transform:
107108
```python

0 commit comments

Comments
 (0)