Closed VRehnberg closed 3 years ago
lens
is not a valid argument for _compose_optic
. That's an internal method that's only supposed to be used with internal objects. If you want to compose two lenses you use the &
operator:
(lens.Fork() & lens).modify(lambda x: x)
Ok, thanks.
Code
Traceback
Traceback (most recent call last): File "", line 1, in
File "/home/viktor/miniconda3/envs/functorch/lib/python3.9/site-packages/lenses/ui/init.py", line 156, in _compose_optic
return UnboundLens(self._optic.compose(optic))
File "/home/viktor/miniconda3/envs/functorch/lib/python3.9/site-packages/lenses/optics/base.py", line 235, in compose
return ComposedLens([self]).compose(other)
File "/home/viktor/miniconda3/envs/functorch/lib/python3.9/site-packages/lenses/optics/base.py", line 617, in compose
if result.kind() is None:
File "/home/viktor/miniconda3/envs/functorch/lib/python3.9/site-packages/lenses/optics/base.py", line 254, in kind
if self._is_kind(optic):
File "/home/viktor/miniconda3/envs/functorch/lib/python3.9/site-packages/lenses/optics/base.py", line 625, in _is_kind
return all(lens._is_kind(cls) for lens in self.lenses)
File "/home/viktor/miniconda3/envs/functorch/lib/python3.9/site-packages/lenses/optics/base.py", line 625, in
return all(lens._is_kind(cls) for lens in self.lenses)
TypeError: 'UnboundLens' object is not callable
Problem
base.py:625
lens._is_kind
isUnboundLens(GetZoomAttrTraversal('_is_kind'))
because of this function