The first and next variables are compared to None and set to a bool value. The isinstance(..., str) looks like it will never succeed (based on my testing).
def items(self) -> Iterator[AnyObject]:
items = self._delegate.json_field('orderedItems' if self.is_ordered() else 'items')
if items is not None:
# ...
elif first := self._delegate.json_field('first') is not None: # <-- first will always be a bool
if isinstance(first,str): # <-- is never true?
first_collection = AnyObject(first).as_collection()
yield from first_collection.items()
else:
raise Exception(f'Cannot process yet: {first}')
elif next := self._delegate.json_field('next') is not None:
# similar issue for next ...
The
first
andnext
variables are compared toNone
and set to a bool value. Theisinstance(..., str)
looks like it will never succeed (based on my testing).